Project

General

Profile

Actions

Bug #41450

closed

PHP Error when languagePackIndex is empty

Added by Alexander Stehlik over 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Language Manager (backend)
Target version:
-
Start date:
2012-09-28
Due date:
% Done:

100%

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

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.

Actions #1

Updated by Gerrit Code Review over 11 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15138

Actions #2

Updated by Kai Vogel over 11 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.

Actions #3

Updated by Alexander Stehlik over 11 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

Actions #4

Updated by Kai Vogel over 11 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/

Actions #5

Updated by Alexander Stehlik over 11 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.

Actions #6

Updated by Gerrit Code Review over 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15138

Actions #7

Updated by Kai Vogel over 11 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.

Actions #8

Updated by Alexander Stehlik over 11 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

Actions #9

Updated by Kai Vogel over 11 years ago

  • Status changed from Under Review to Accepted

For me it's ok.

Actions #10

Updated by Kai Vogel over 11 years ago

  • Status changed from Accepted to Under Review
Actions #11

Updated by Oliver Hader about 11 years ago

  • Target version set to 2222
Actions #12

Updated by Oliver Hader about 11 years ago

  • Project changed from 2315 to TYPO3 Core
Actions #13

Updated by Oliver Hader about 11 years ago

  • Category set to Language Manager (backend)
Actions #14

Updated by Oliver Hader about 11 years ago

  • Target version deleted (2222)
Actions #15

Updated by Gerrit Code Review almost 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

Actions #16

Updated by Gerrit Code Review over 10 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

Actions #17

Updated by Gerrit Code Review over 10 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

Actions #18

Updated by Gerrit Code Review over 10 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

Actions #19

Updated by Gerrit Code Review over 10 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

Actions #20

Updated by Alexander Stehlik over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #21

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF