Skip to content

Commit

Permalink
Merge pull request #53 from sitegeist/bugfix/89899/arrayToStringConve…
Browse files Browse the repository at this point in the history
…rsion

[BUGFIX] #89899 Fix translation handling due to occurence of multidim…
  • Loading branch information
galoppi authored Jun 4, 2024
2 parents 234eb75 + 3d65350 commit 1a2c52c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
14 changes: 6 additions & 8 deletions Classes/ViewHelpers/TranslateElementPropertyViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl
$property = $arguments['renderingOptionProperty'];
}

if (empty($property)) {
$propertyParts = [];
} elseif (\is_array($property)) {
$propertyParts = $property;
} else {
$propertyParts = [$property];
}

/** @var TYPO3\CMS\Form\FormRuntime $formRuntime */
$formRuntime = $renderingContext
->getViewHelperVariableContainer()
Expand Down Expand Up @@ -118,6 +110,12 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl
);
}

/*
* Parent renderStatic will call TranslationService->translateFormElementValue(...).
* It can not handle properties that are multidimensional arrays.
*/
$arguments['property'] = self::getPropertyName($property);

$ret = parent::renderStatic($arguments, $renderChildrenClosure, $renderingContext);
if ($property === 'label' ||
$property === 'elementDescription' ||
Expand Down
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ default language.
| 2.1.x | 11.5.x | Compatibility for TYPO3 11.5 |
| 2.3.0 | 11.5.x | Compatibility for PHP 8.1 |
| 2.3.2 | 11.5.x | Added event dispatcher to show translate labels or not |
| 2.3.5 | 11.5.x | Bugfix: PHP Warning: Array to string conversion | |
| 2.3.5 | 11.5.x | Bugfix: PHP Warning: Array to string conversion |
| 2.3.6 | 11.5.x | Bugfix: PHP Warning: Array to string conversion |

## How to activate for BE users

Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'author' => 'Alexander Bohndorf',
'author_email' => '[email protected]',
'state' => 'beta',
'version' => '2.3.5',
'version' => '2.3.6',
'constraints' => [
'depends' => [
'typo3' => '10.0.0-11.5.99',
Expand Down

0 comments on commit 1a2c52c

Please sign in to comment.