From 40911e3fabd6e60e78c1febbbb2bf3100f620398 Mon Sep 17 00:00:00 2001 From: Max Amann Date: Tue, 4 Jun 2024 12:21:02 +0200 Subject: [PATCH 1/2] [BUGFIX] #89899 Fix translation handling due to occurence of multidimensional arrays in form select fields. --- .../TranslateElementPropertyViewHelper.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Classes/ViewHelpers/TranslateElementPropertyViewHelper.php b/Classes/ViewHelpers/TranslateElementPropertyViewHelper.php index c311360..960bc13 100644 --- a/Classes/ViewHelpers/TranslateElementPropertyViewHelper.php +++ b/Classes/ViewHelpers/TranslateElementPropertyViewHelper.php @@ -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() @@ -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' || From 3d65350a6154c98050f34ded5598119cb6261505 Mon Sep 17 00:00:00 2001 From: Alexander Bohndorf Date: Tue, 4 Jun 2024 13:52:24 +0200 Subject: [PATCH 2/2] [BUGFIX] PHP Warning: Array to string conversion --- Readme.md | 3 ++- ext_emconf.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index 6f2e208..cd105e8 100644 --- a/Readme.md +++ b/Readme.md @@ -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 diff --git a/ext_emconf.php b/ext_emconf.php index 87fd955..432ca60 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -7,7 +7,7 @@ 'author' => 'Alexander Bohndorf', 'author_email' => 'bohndorf@sitegeist.de', 'state' => 'beta', - 'version' => '2.3.5', + 'version' => '2.3.6', 'constraints' => [ 'depends' => [ 'typo3' => '10.0.0-11.5.99',