Review main Merged

74992[BUGFIX] Use less strict check for empty translated values

Elias Häußler CR +2 V +2 Hard +253 −12 updated 07/02/22, 20:42

Commit message

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.

Review

  • Code review CR +2 Done
    • waldhacker +2
    • Björn Jacob +1
  • Verified V +2 Done
    • waldhacker +2
    • Björn Jacob +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 2233

Show 58 earlier messages
  1. Elias Häußler uploaded patch set 1 06/29/22, 10:43

  2. Oliver Klee commented on patch set 1 06/29/22, 10:50

    TranslationService.php:701

    We don't use Yoda Conditions (https://de.wikipedia.org/wiki/Yoda_Conditions) in TYPO3 (and they kind of make my brain hurt ;-) ). Please let's not start with them now. if ($translatedValue === true) { return true; } if (is_string($translatedValue)) { return trim($translatedValue) === ''; }
  3. core-ci voted on patch set 1 V +1 06/29/22, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28478

  4. Elias Häußler uploaded patch set 2 06/29/22, 11:27

  5. Elias Häußler commented on patch set 2 06/29/22, 11:27

    TranslationService.php:701 Reply

    Ack
  6. core-ci voted on patch set 2 V -1 06/29/22, 11:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28481

  7. core-ci voted on patch set 2 V +1 06/29/22, 11:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28481

  8. Oliver Klee voted on patch set 2 CR +1 06/29/22, 11:43

  1. Elias Häußler uploaded patch set 3 06/29/22, 12:06

  2. Elias Häußler uploaded patch set 4 06/29/22, 12:07

  3. Oliver Klee voted on patch set 4 CR +1 06/29/22, 12:09

  4. core-ci voted on patch set 4 V +1 06/29/22, 12:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28485

  5. core-ci voted on patch set 3 V +1 06/29/22, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28484

  6. Tobias Jungmann voted on patch set 4 CR +1 06/30/22, 12:25

  7. waldhacker uploaded patch set 5 06/30/22, 12:30

  8. core-ci voted on patch set 5 V -1 06/30/22, 12:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28532

  9. waldhacker uploaded patch set 6 06/30/22, 12:44

  10. core-ci voted on patch set 6 V +1 06/30/22, 12:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28533

  11. Elias Häußler uploaded patch set 7 06/30/22, 12:57

  12. core-ci voted on patch set 7 V -1 06/30/22, 13:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28534

  13. core-ci voted on patch set 7 V +1 06/30/22, 13:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28534

  14. Elias Häußler updated the commit message in patch set 8 07/01/22, 09:26

  15. core-ci voted on patch set 8 V +1 07/01/22, 09:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28555

  16. Björn Jacob voted on patch set 8 CR +1 07/01/22, 09:36

  17. Tobias Jungmann voted on patch set 8 CR +1 07/01/22, 09:40

  18. Björn Jacob voted on patch set 8 V +1 07/01/22, 09:59

  19. Björn Jacob commented on patch set 8 07/01/22, 10:05

    @Elias can we add an information why we are not backporting it to v11. Other people might ask and we can avoid additional communication by mentioning the "problem" of not having it in v11.
  20. Elias Häußler updated the commit message in patch set 9 07/01/22, 14:37

  21. Elias Häußler commented on patch set 9 07/01/22, 14:38

    Reply

    Done
  22. core-ci voted on patch set 9 V +1 07/01/22, 14:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28580

  23. Björn Jacob voted on patch set 9 V +1 CR +1 07/01/22, 21:00

  24. waldhacker voted on patch set 9 V +2 CR +2 07/02/22, 20:39

  25. waldhacker merged patch set 10 07/02/22, 20:42