Project

General

Profile

Actions

Bug #45236

closed

makeLocalizationPanel throws an error

Added by Arno Dudek about 11 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-02-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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']));
}

Actions #1

Updated by Mario Rimann about 11 years ago

I've just tried to reproduce this issue on the current 4.7.x branch from Git and could not really reproduce this issue - alltough I've also seen it before. Could you share more details on your TYPO3 version, installed extensions etc.?

I'm especially wondering about the ux_ in the classname - is there some extension installed that XCLASSes the core class for displaying the records?

What records do you have on the page to trigger this error?

Actions #2

Updated by Arno Dudek about 11 years ago

Oha! I can't find the error any moreā€¦
So far I can remember it was also in combination with the extension gridelements. It seems the error gone, at last update.

But the question will be the same why $this->translateTools->translationInfo returns a string and not an array. It could be sloved like in the file class.t3lib_tceforms.php but I think it will be better if it throws an error there where the string "Record "tt_news_166" seems to be a translation already (has a language value "2", relation to record "165")" created.

Actions #3

Updated by Mario Rimann about 11 years ago

I've now seen this error also in a 4.7.10 setup where the path in the error message tells me that the class has not been xclassed or the like:

PHP Warning: Illegal string offset 'translations' in /path/to/typo3_src-4.7.10/typo3/class.db_list_extra.inc line 1539
Actions #4

Updated by Arno Dudek about 11 years ago

  • Target version set to 4.5.26

Get the error again! displayErrors was deactivated ;)

After searching again I found some lines after the condition if (is_array($translations))

So everything will be good, if

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

            // Language title and icon:
        $out[0] = $this->languageFlag($row[$TCA[$table]['ctrl']['languageField']]);

        if (is_array($translations))    {


will be changed to
            // Language title and icon:
        $out[0] = $this->languageFlag($row[$TCA[$table]['ctrl']['languageField']]);

        if (is_array($translations))    {

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

Would be cool to have it also for 4.5.26.
Thanks!

Actions #5

Updated by Mathias Schreiber over 9 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Mathias Schreiber
  • Is Regression set to No

Can you try to reproduce on current master?

Actions #6

Updated by Alexander Opitz almost 9 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee deleted (Mathias Schreiber)
  • Target version deleted (4.5.26)

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF