[BUGFIX] Fix translation overlay in RECORDS
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 22 Oct 2012 15:36:28 +0000 (17:36 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 29 Oct 2012 11:48:42 +0000 (12:48 +0100)
When RECORDS content object is used with pages as table
no translation overlay is done.

Fix that by adding a check and selecting the proper
overlay method in this case.

Resolves: #42279
Releases: 4.5, 4.6, 4.7, 6.0

Change-Id: I9be903c06abe8532390f814e2ff29825003359d7
Reviewed-on: http://review.typo3.org/15885
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Mattias Nilsson
Tested-by: Mattias Nilsson
Reviewed-by: Markus Klein
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/frontend/Classes/ContentObject/RecordsContentObject.php

index 1cc2498..f710054 100644 (file)
@@ -80,7 +80,11 @@ class RecordsContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractCon
                                $GLOBALS['TSFE']->sys_page->versionOL($val['table'], $row);
                                // Language overlay:
                                if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) {
-                                       $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($val['table'], $row, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL);
+                                       if ($val['table'] === 'pages') {
+                                               $row = $GLOBALS['TSFE']->sys_page->getPageOverlay($row);
+                                       } else {
+                                               $row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($val['table'], $row, $GLOBALS['TSFE']->sys_language_content, $GLOBALS['TSFE']->sys_language_contentOL);
+                                       }
                                }
                                // Might be unset in the content overlay things...
                                if (is_array($row)) {