Revert "[BUGFIX] setRespectSysLanguage(FALSE) doesn't prevent language overlay" 71/22671/2
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 29 Jul 2013 19:11:37 +0000 (21:11 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 29 Jul 2013 19:11:52 +0000 (21:11 +0200)
This reverts commit 58c9017fbdeb9108c15e80de4fb726c1f9273b8b

The patch introduces a regression. We have no easy fix for it, so the patch gets reverted. Sorry for now, we come back to the problem.

Change-Id: I8b608146a72cd48988c77ecf1036ac85074e03b0
Reviewed-on: https://review.typo3.org/22671
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/extbase/Classes/Persistence/Generic/Storage/Typo3DbBackend.php

index dd20954..bdca5e0 100644 (file)
@@ -1185,8 +1185,7 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
                        $overlayedRows = array();
                        foreach ($rows as $row) {
                                // If current row is a translation select its parent
-                               if ($querySettings->getRespectSysLanguage()
-                                       && isset($tableName) && isset($GLOBALS['TCA'][$tableName])
+                               if (isset($tableName) && isset($GLOBALS['TCA'][$tableName])
                                        && isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
                                        && isset($GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField'])
                                ) {
@@ -1205,16 +1204,14 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
                                if ($pageRepository->versioningPreview && isset($row['_ORIG_uid'])) {
                                        $row['uid'] = $row['_ORIG_uid'];
                                }
-                               if ($querySettings->getRespectSysLanguage()) {
-                                       if ($tableName == 'pages') {
-                                               $row = $pageRepository->getPageOverlay($row, $querySettings->getSysLanguageUid());
-                                       } elseif (isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
-                                               && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== ''
-                                       ) {
-                                               if (in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], array(-1, 0))) {
-                                                       $overlayMode = $languageMode === 'strict' ? 'hideNonTranslated' : '';
-                                                       $row = $pageRepository->getRecordOverlay($tableName, $row, $querySettings->getSysLanguageUid(), $overlayMode);
-                                               }
+                               if ($tableName == 'pages') {
+                                       $row = $pageRepository->getPageOverlay($row, $querySettings->getSysLanguageUid());
+                               } elseif (isset($GLOBALS['TCA'][$tableName]['ctrl']['languageField'])
+                                       && $GLOBALS['TCA'][$tableName]['ctrl']['languageField'] !== ''
+                               ) {
+                                       if (in_array($row[$GLOBALS['TCA'][$tableName]['ctrl']['languageField']], array(-1, 0))) {
+                                               $overlayMode = $languageMode === 'strict' ? 'hideNonTranslated' : '';
+                                               $row = $pageRepository->getRecordOverlay($tableName, $row, $querySettings->getSysLanguageUid(), $overlayMode);
                                        }
                                }
                                if ($row !== NULL && is_array($row)) {
@@ -1311,4 +1308,4 @@ class Typo3DbBackend implements \TYPO3\CMS\Extbase\Persistence\Generic\Storage\B
        }
 }
 
-?>
+?>
\ No newline at end of file