[BUGFIX] Use less strict check for empty translated values
When translating values in EXT:form, we must ensure to handle translated values correctly. Prior to this change, the native PHP function "empty()" was used to determine if a translated value is valid. This, however, generates wrong translations for valid empty values, such as "0". Therefore, the native function has been replaced by a helper method in TranslationService. This fix is a potential change of behavior. Translated values that were previously interpreted as "empty" might now be rendered as-is. This can possibly lead to a different rendering result in Frontend forms. Therefore, this change is not backported to previous versions. Resolves: #91833 Releases: main Change-Id: I373ca97f91b97495f605ad3344b355539966a371 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74992 Tested-by:core-ci <typo3@b13.com> Tested-by:
Björn Jacob <bjoern.jacob@tritum.de> Tested-by:
waldhacker <hello@waldhacker.dev> Reviewed-by:
Björn Jacob <bjoern.jacob@tritum.de> Reviewed-by:
waldhacker <hello@waldhacker.dev>
Showing
- typo3/sysext/form/Classes/Service/TranslationService.php 43 additions, 12 deletionstypo3/sysext/form/Classes/Service/TranslationService.php
- typo3/sysext/form/Tests/Unit/Service/Fixtures/locallang_empty_values.php 59 additions, 0 deletions...rm/Tests/Unit/Service/Fixtures/locallang_empty_values.php
- typo3/sysext/form/Tests/Unit/Service/Fixtures/locallang_empty_values.xlf 28 additions, 0 deletions...rm/Tests/Unit/Service/Fixtures/locallang_empty_values.xlf
- typo3/sysext/form/Tests/Unit/Service/TranslationServiceTest.php 123 additions, 0 deletions...sysext/form/Tests/Unit/Service/TranslationServiceTest.php
Please register or sign in to comment