[BUGFIX] Fix translation overlay in RECORDS 84/17184/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 22 Oct 2012 15:36:28 +0000 (17:36 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 21 Mar 2013 22:51:42 +0000 (23:51 +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: https://review.typo3.org/17184
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/cms/tslib/content/class.tslib_content_records.php

index 3f81f52..f914bb3 100644 (file)
@@ -88,12 +88,16 @@ class tslib_content_Records extends tslib_content_Abstract {
 
                                        // 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
+                                               );
+                                       }
                                }
 
                                if (is_array($row)) { // Might be unset in the content overlay things...