[BUGFIX] Illegal string offset 'translations' in DatabaseRecordList 79/19779/3
authorPhilipp Gampe <philipp.gampe@typo3.org>
Wed, 10 Apr 2013 15:41:53 +0000 (17:41 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 15 Jun 2013 13:33:06 +0000 (15:33 +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/19779
Reviewed-by: Dmitry Dulepov
Reviewed-by: Alexander Opitz
Reviewed-by: Heiko Kromm
Tested-by: Heiko Kromm
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 90ded65..d154b15 100644 (file)
@@ -154,8 +154,8 @@ abstract class AbstractRecordList {
         */
        public $languageIconTitles = array();
 
-       // TranslateTools object
        /**
+        * @var \TYPO3\CMS\Backend\Configuration\TranslationConfigurationProvider
         * @todo Define visibility
         */
        public $translateTools;
index 94995f1..19c6916 100644 (file)
@@ -1267,11 +1267,13 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
                        0 => '',
                        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[$GLOBALS['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) {
@@ -1549,4 +1551,4 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
 }
 
 
-?>
\ No newline at end of file
+?>