[BUGFIX] No version overlay should be done for sys_language 03/23203/2
authorLienhart Woitok <lienhart.woitok@netlogix.de>
Tue, 27 Nov 2012 01:43:04 +0000 (02:43 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 20 Aug 2013 21:23:14 +0000 (23:23 +0200)
The tables sys_language and static_languages do not support
versioning. Therefore, when doing a version preview, no
version overlay should be applied to them.

Change-Id: I37be782601fc37e78a74d2459b6f246c5107b701
Fixes: #37892
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/23203
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index ad2cebd..f2a5a78 100644 (file)
@@ -2550,9 +2550,11 @@ class TypoScriptFrontendController {
                // Finding the ISO code:
                if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables') && $this->sys_language_content) {
                        // using sys_language_content because the ISO code only (currently) affect content selection from FlexForms - which should follow "sys_language_content"
-                       $sys_language_row = $this->sys_page->getRawRecord('sys_language', $this->sys_language_content, 'static_lang_isocode');
+                       // Set the fourth parameter to TRUE in the next two getRawRecord() calls to
+                       // avoid versioning overlay to be applied as it generates an SQL error
+                       $sys_language_row = $this->sys_page->getRawRecord('sys_language', $this->sys_language_content, 'static_lang_isocode', TRUE);
                        if (is_array($sys_language_row) && $sys_language_row['static_lang_isocode']) {
-                               $stLrow = $this->sys_page->getRawRecord('static_languages', $sys_language_row['static_lang_isocode'], 'lg_iso_2');
+                               $stLrow = $this->sys_page->getRawRecord('static_languages', $sys_language_row['static_lang_isocode'], 'lg_iso_2', TRUE);
                                $this->sys_language_isocode = $stLrow['lg_iso_2'];
                        }
                }