[BUGFIX] Category localization cannot be rendered 73/27673/5
authorOliver Hader <oliver@typo3.org>
Mon, 17 Feb 2014 22:11:45 +0000 (23:11 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 19 Feb 2014 20:13:24 +0000 (21:13 +0100)
Localized sys_category records cannot be rendered in frontend,
since only records with a positive pid value are overlaid -
however, sys_category is stored on the root-level.

Resolves: #56059
Releases: 6.2, 6.1
Change-Id: I211dad5086adf30723ef4f44757fe6a3121ac29e
Reviewed-on: https://review.typo3.org/27673
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/workspaces/Tests/Functional/DataHandling/ManyToMany/AbstractActionTestCase.php

index 1188701..804d8c0 100644 (file)
@@ -231,9 +231,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
                $responseContent = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId)->getResponseContent();
                $this->assertResponseContentStructureHasRecords(
                        $responseContent, self::TABLE_Content . ':' . self::VALUE_ContentIdFirst, 'categories',
-                       // @todo Category localization cannot be rendered - http://forge.typo3.org/issues/56059
-                       // self::TABLE_Category, 'title', array('[Translate to Dansk:] Category A', 'Category B')
-                       self::TABLE_Category, 'title', array('Category A', 'Category B')
+                       self::TABLE_Category, 'title', array('[Translate to Dansk:] Category A', 'Category B')
                );
        }
 
index dbc3b9f..bd89657 100644 (file)
@@ -105,6 +105,14 @@ class PageRepository {
        protected $cache_getMountPointInfo = array();
 
        /**
+        * @var array
+        */
+       protected $tableNamesAllowedOnRootLevel = array(
+               'sys_file_metadata',
+               'sys_category',
+       );
+
+       /**
         * Named constants for "magic numbers" of the field doktype
         */
        const DOKTYPE_DEFAULT = 1;
@@ -366,7 +374,7 @@ class PageRepository {
                                $hookObject->getRecordOverlay_preProcess($table, $row, $sys_language_content, $OLmode, $this);
                        }
                }
-               if ($row['uid'] > 0 && ($row['pid'] > 0 || $table == 'sys_file_metadata')) {
+               if ($row['uid'] > 0 && ($row['pid'] > 0 || in_array($table, $this->tableNamesAllowedOnRootLevel))) {
                        if ($GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['languageField'] && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) {
                                if (!$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable']) {
                                        // Will not be able to work with other tables (Just didn't implement it yet; Requires a scan
index b55ed8e..838c065 100644 (file)
@@ -328,9 +328,7 @@ abstract class AbstractActionTestCase extends \TYPO3\CMS\Core\Tests\Functional\D
                $responseContent = $this->getFrontendResponse(self::VALUE_PageId, self::VALUE_LanguageId, self::VALUE_BackendUserId, self::VALUE_WorkspaceId)->getResponseContent();
                $this->assertResponseContentStructureHasRecords(
                        $responseContent, self::TABLE_Content . ':' . self::VALUE_ContentIdFirst, 'categories',
-                       // @todo Category localization cannot be rendered - http://forge.typo3.org/issues/56059
-                       // self::TABLE_Category, 'title', array('[Translate to Dansk:] Category A', 'Category B')
-                       self::TABLE_Category, 'title', array('Category A', 'Category B')
+                       self::TABLE_Category, 'title', array('[Translate to Dansk:] Category A', 'Category B')
                );
        }