Skip to content

Commit

Permalink
[BUGFIX] Make it possible to translate selectMultipleSideBySide
Browse files Browse the repository at this point in the history
For the default language it was possible to view the field, but on
translating the dataset, the following exception is thrown:
'PHP Warning: Invalid argument supplied for foreach() in
backend/Classes/Form/Element/SelectMultipleSideBySideElement.php line 66'

As the defaultLanguageRow keeps to be "unparsed", the $selectedItems
could be a comma separated string within the method
TYPO3\CMS\Backend\Form\Element\SelectMultipleSideBySideElement::renderReadOnly
if the TCA configuration of a field is set to 'defaultAsReadonly'.

Resolves: #77155
Releases: master, 8.7, 7.6
Change-Id: Id9380fe3761e683352166565ed1a7e56f5e64190
Reviewed-on: https://review.typo3.org/55674
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
manuelselbach authored and lolli42 committed Feb 12, 2018
1 parent ea59516 commit eaf148d
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -348,6 +348,9 @@ protected function renderReadOnly()

$possibleItems = $config['items'];
$selectedItems = $parameterArray['itemFormElValue'] ?: [];
if (!is_array($selectedItems)) {
$selectedItems = GeneralUtility::trimExplode(',', $selectedItems, true);
}
$selectedItemsCount = count($selectedItems);

$autoSizeMax = MathUtility::forceIntegerInRange($config['autoSizeMax'], 0);
Expand Down

0 comments on commit eaf148d

Please sign in to comment.