[BUGFIX] Extbase tries to overlay pages_language_overlay records 62/28362/2
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 13 Mar 2014 01:46:22 +0000 (21:46 -0400)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 13 Mar 2014 20:55:09 +0000 (21:55 +0100)
Method doLanguageAndWorkspaceOverlay of
Extbase\Persistence\Generic\Storage\Typo3DbBackend should not attempt
to get a parent record if the overlays are in a separate table (most
probably pages_language_overlay) by checking whether
$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'] is set.

Resolves: #56855
Releases: 6.0, 6.1, 6.2
Change-Id: I2cb53bc4733ee626ca0ae92e5dd91073d88ecc9d
Reviewed-on: https://review.typo3.org/28362
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php

index bdca5e0..2a161ed 100644 (file)
@@ -1188,6 +1188,7 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
                                if (isset($tableName) && isset($GLOBALS['TCA'][$tableName])
                                        && isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
                                        && isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
+                                       && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
                                ) {
                                        if (isset($row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']])
                                                && $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0
@@ -1208,6 +1209,7 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
                                        $row = $pageRepository->getPageOverlay($row, $querySettings->getSysLanguageUid());
                                } elseif (isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
                                        && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== ''
+                                       && !isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerTable'])
                                ) {
                                        if (in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], array(-1, 0))) {
                                                $overlayMode = $languageMode === 'strict' ? 'hideNonTranslated' : '';
@@ -1308,4 +1310,4 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        }
 }
 
-?>
\ No newline at end of file
+?>