Project

General

Profile

Actions

Bug #78344

closed

Missing use case for overriding language labels with TS and Extbase

Added by Online Now! GmbH over 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase + l10n
Target version:
-
Start date:
2016-10-19
Due date:
% Done:

0%

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

Description

I noticed a TypoScript use case not covered by the LocalizationUtility while overriding language labels with TS. It occured with the extension sr_feuser_register, but i think it is more of a extbase problem. In that extension some labels are defined like this:

fe_users.status = Label
fe_users.status.I.0 = Option 1
fe_users.status.I.1 = Option 2

The TypoScriptService Class puts the value of fe_users.status with the key _typoScriptNodeValue in the parsed array. This is not considered in the function LocalizationUtility::flattenTypoScriptLabelArray. The result of this is that the label for fe_users.status is dropped. The lables fe_users.status.I.0 and fe_users.status.I.1 are added though.

This case is also not covered by the unit tests.

I fixed the problem by adding the following to the LocalizationUtility::flattenTypoScriptLabelArray function:

if (is_array($labelValue)) {
    if(isset($labelValue['_typoScriptNodeValue'])) {
        $result[$key] = $labelValue['_typoScriptNodeValue'];
        unset($labelValue['_typoScriptNodeValue']);
    }
    $labelValue = self::flattenTypoScriptLabelArray($labelValue, $key);
    $result = array_merge($result, $labelValue);
} else {
    $result[$key] = $labelValue;
}

A similar code can be found in the TypoScriptService::convertPlainArrayToTypoScriptArray function.

The problem occured in TYPO 7.6.11, but i think it affects all versions up until 8 ( master ).


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #81095: Indexed Search Label "displayResults" not translatable by TypoScriptClosed2017-05-01

Actions
Actions

Also available in: Atom PDF