[BUGFIX] Extbase tries to overlay pages_language_overlay records 33/28333/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:54:24 +0000 (21:54 +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/28333
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Marc Bastian Heinrichs
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php

index 803e0ca..cebf3cd 100644 (file)
@@ -1239,6 +1239,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
@@ -1259,6 +1260,7 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
                                        $row = $pageRepository->getPageOverlay($row, $querySettings->getLanguageUid());
                                } 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 = $querySettings->getLanguageMode() === 'strict' ? 'hideNonTranslated' : '';