Bug #76785

Wrong Selected option in localised TCA columns of type select when l10n_mode="exclude"

Added by Jeffrey Nellissen about 3 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2016-06-24
Due date:
% Done:

0%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If l10n_mode is set to exclude, the selected field in localised elements is wrong.
In this case the variable $parameterArray['itemFormElValue'] seems to be a string, not an array as expected in SelectSingleElement.php
In fact T3 will take only the first letter as related uid for translated record
aE Default Element has a relation to an element with uid 37, select field of translated record will shown the element with the uid 3 as selected option

Workaround for me is currently:

change

        if (!empty($parameterArray['itemFormElValue'])) {
            $selectedValue = (string)$parameterArray['itemFormElValue'][0];
        }

to

       if (!empty($parameterArray['itemFormElValue'])) {
                if (is_array($parameterArray['itemFormElValue'])){
                        $selectedValue = (string)$parameterArray['itemFormElValue'][0];
                } else {
                        $selectedValue = (string)$parameterArray['itemFormElValue'];
                }
        }

in ../sysext/backend/Classes/Form/Element/SelectSingleElement.php on line 94 ff

But im wondering, if it should be better to fix this in the method, which fill the $parameterArray for exclude Elements

Best regards,
Jeffrey


Related issues

Duplicated by TYPO3 Core - Bug #77257: The selection of a selectbox with the l10n_display type of defaultAsReadonly in TCA is wrong for a localized record New 2016-07-26

History

#1 Updated by Andreas Krämer 7 months ago

  • Duplicated by Bug #77257: The selection of a selectbox with the l10n_display type of defaultAsReadonly in TCA is wrong for a localized record added

Also available in: Atom PDF