[BUGFIX] Illegal string offset 'translations' in DatabaseRecordList 60/21460/2
authorPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 15 Jun 2013 14:55:32 +0000 (16:55 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 15 Jun 2013 15:02:12 +0000 (17:02 +0200)
The return value of TranslationConfigurationProvider->translationInfo
normally is an array, but it is a string in case of an error.
Move the line below the is_array() check, because it is only needed
inside.

Fixes: #47103
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: Ia781eae987d9295bc2b299f83c087669c96dfd00
Reviewed-on: https://review.typo3.org/21460
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
typo3/class.db_list_extra.inc

index 83de4c7..7fe66c3 100644 (file)
@@ -1556,14 +1556,14 @@ class localRecordList extends recordList {
                        1 => '',
                );
 
+                       // Reset translations
+               $this->translations = array();
                $translations = $this->translateTools->translationInfo($table, $row['uid'], 0, $row, $this->selFieldList);
-               $this->translations = $translations['translations'];
-
                        // Language title and icon:
                $out[0] = $this->languageFlag($row[$TCA[$table]['ctrl']['languageField']]);
 
                if (is_array($translations))    {
-
+                       $this->translations = $translations['translations'];
                                // Traverse page translations and add icon for each language that does NOT yet exist:
                        $lNew = '';
                        foreach($this->pageOverlays as $lUid_OnPage => $lsysRec)        {
@@ -1880,4 +1880,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']);
 }
 
-?>
\ No newline at end of file
+?>