Issue Bug Closed

#45236makeLocalizationPanel throws an error

Arno Dudek 02/07/13, 10:19 updated 06/15/15, 14:12

Description

Tested in TYPO3 4.5 and 4.7.

In the function class.ux_db_list_extra.php file class.ux_db_list_extra.php on line 1520 the variable $translations can be an array and a string if there are translated records. If there is a translated record $this->translateTools->translationInfo returns somthing like this:

string(107) "Record "tt_news_166" seems to be a translation already (has a language value "2", relation to record "165")"

In the next line

$this->translations = $translations['translations'];

Will not ask if is an array so you get an error
> PHP Warning: Illegal string offset ‘translations’ in /home/public_html/typo3/class.db_list_extra.inc line 1522

In the file class.t3lib_tceforms.php in the function registerDefaultLanguageData in line 3485 there will be ask if an array is returned. Perhaps it should be like this.

$tInfo = $t8Tools->translationInfo($lookUpTable, intval($rec[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']]), $prL['uid']);
if (is_array($tInfo['translations']) && is_array($tInfo['translations'][$prL['uid']])) {
    $this->additionalPreviewLanguageData[$table . ':' . $rec['uid']][$prL['uid']] = t3lib_BEfunc::getRecordWSOL($table, intval($tInfo['translations'][$prL['uid']]['uid']));
}

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.