Project

General

Profile

Actions

Bug #20219

closed

LOCAL_LANG default values are overwritten by localized text

Added by Mathias Gisch over 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2009-03-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Consider the following XML (see XML-file attached):


<T3locallang>
<meta type="array">
<type>module</type>
<description>Language labels for testing purposes</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="button1">Button 1 - Description (EN)</label>
<label index="button2">Button 2 - Description (EN)</label>
<label index="button3">Button 3 - Description (EN)</label>
</languageKey>
<languageKey index="fr" type="array">
<label index="button1">Button 1 - Description (FR)</label>
<label index="button2">Button 2 - Description (FR)</label>
</languageKey>
</data>
</T3locallang>

When tring to get the french Label for Button 3, you expect to receive "Button 3 - Description (EN)", since there is no french localized label for Button 3.
Instead you get "Button 2 - Description (FR)".
The last default value, is always replaced by the last localized value (see Screenshot).

This is caused by the readLLXMLfile-function. The function iterates through the $LOCAL_LANG['default'] values by assigning by reference to $labelValue (line 4186).
Since $labelValue is not unset later, the reference will stay on the last value of $LOCAL_LANG['default']. Later then $labelValue is used again to iterate through $LOCAL_LANG[$langKey], and it then overwrites the last value in $LOCAL_LANG['default'] since the reference is still intact.
(issue imported from #M10742)


Files

t3libdiv_readLLXMLfile.patch (564 Bytes) t3libdiv_readLLXMLfile.patch Administrator Admin, 2009-03-20 13:49
locallang-test.xml (674 Bytes) locallang-test.xml Administrator Admin, 2009-03-20 13:50
debug.png (8.71 KB) debug.png Administrator Admin, 2009-03-20 13:50
Actions #1

Updated by Oliver Hader over 15 years ago

Sounds reasonable...
Did you post this as RFC to the core list as the accordant tag of this issue tells? I couldn't find it there...

Actions #2

Updated by Mathias Gisch over 15 years ago

No, I am just checking out the trunk. Will post it then ...

Actions #3

Updated by Oliver Hader over 15 years ago

Whatever... I'm going to take care of that RFC

Actions #4

Updated by Oliver Hader over 15 years ago

Committed to SVN:
  • TYPO3_4-2 (rev. 5212)
  • Trunk (rev. 5213)
Actions

Also available in: Atom PDF