Bug #41450
closedPHP Error when languagePackIndex is empty
100%
Description
I tried to update the language packs and got this PHP error:
Fatal error: Cannot use string offset as an array in typo3/sysext/lang/Classes/Controller/LanguageController.php on line 208
The problem occurs, if the languagePackIndex is empty (see http://ter.rz.tu-clausthal.de/ter/c/o/core-l10n/core-l10n.xml for example):
<?xml version="1.0" standalone="yes" ?> <TERlanguagePackIndex> <meta> <timestamp>1348788881</timestamp> <date>2012-09-28 01:34:41</date> </meta> <languagePackIndex> </languagePackIndex> </TERlanguagePackIndex>
The problem is in the XML parser in TYPO3\CMS\Lang\Utility\Connection\Ter::parseL10nXML($string)
. It will fill the tag with a string containing the space / linebreaks between the two languagePackIndex XML tags. The isset() check in TYPO3\CMS\Lang\Controller\LanguageController::checkTranslationForExtension($languages, $extensionKey)
therefore returns TRUE which results in the error above.
Updated by Gerrit Code Review about 12 years ago
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15138
Updated by Kai Vogel about 12 years ago
Note: The problem is already solved in the new language module in TYPO3 version 6.0. See http://forge.typo3.org/issues/39963.
Updated by Alexander Stehlik about 12 years ago
Hi Kai,
thanks for the reply.
I'm using the lang module in the current master (all submodules updated) and I'm getting this error.
Am I using the newest version or is it available somewhere else?
Kind regards,
Alex
Updated by Kai Vogel about 12 years ago
Hi Alex, the changes are currently waiting to be merged, therefore they are not yet present in the trunk. See: https://review.typo3.org/#/c/14683/
Updated by Alexander Stehlik about 12 years ago
Hi Kai,
OK, the patch fixes the issue.
I'm a bit unsure if I should abandon my patch because in my eyes it solves a general problem in the XML parser (TYPO3\CMS\Lang\Utility\Connection\Ter::parseL10nXML($string)
) with handling empty tags.
When you think it is obsolete you can close the issue and I'll abandon the patch.
Kind regards,
Alex.
Updated by Gerrit Code Review about 12 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15138
Updated by Kai Vogel about 12 years ago
- Status changed from New to Under Review
- Assignee set to Kai Vogel
The problem is that the functionality has changed. A check with "isset()" now returns FALSE because the value will never been set if it's empty or contains only spaces. It is necessary to make sure that nothing gets broken with this change.
Updated by Alexander Stehlik about 12 years ago
Hi Kai,
I just did a quick search through the files. It seems \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility\Ter::fetchTranslationStatus()
is only used in the LanguageController
(in the current master with the patch for #39963 applied). This method is the only one that uses the parseL10nXML()
method.
Kind regards,
Alex
Updated by Kai Vogel about 12 years ago
- Status changed from Under Review to Accepted
For me it's ok.
Updated by Kai Vogel about 12 years ago
- Status changed from Accepted to Under Review
Updated by Oliver Hader over 11 years ago
- Project changed from 2315 to TYPO3 Core
Updated by Oliver Hader over 11 years ago
- Category set to Language Manager (backend)
Updated by Gerrit Code Review over 11 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/15138
Updated by Gerrit Code Review almost 11 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/15138
Updated by Gerrit Code Review almost 11 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/15138
Updated by Gerrit Code Review almost 11 years ago
Patch set 1 for branch TYPO3_6-1 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26902
Updated by Gerrit Code Review almost 11 years ago
Patch set 1 for branch TYPO3_6-0 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/26903
Updated by Alexander Stehlik almost 11 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 6234641597a374aa27f66babf920402cbc3c48eb.