Review main Merged

87010[BUGFIX] Prevent PHP errors for empty Fluid templates

Simon Praetorius CR +2 V +2 Normal +126 −1 updated 11/19/24, 12:07

Commit message

Because of the internal Fluid implementation, Fluid's `render()`
method does not always return a string. If a template only contains
an integer, an integer is returned, if only a ViewHelper is called that
returns an array, an array is returned. Most importantly, empty
template files return `null` instead of an empty string.

For TYPO3's Fluid adapter, this behavior doesn't make sense. Thus,
the result is now cast to string, which prevents PHP errors in the most
common use cases.

Review

  • Code review CR +2 Done
    • Simon Praetorius +2
    • Garvin Hicking +1
    • Christian Kuhn +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Simon Praetorius +2
    • Garvin Hicking +1
    • Christian Kuhn +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1726

Show 1 earlier messages
  1. Simon Praetorius uploaded patch set 1 11/18/24, 10:24

  1. Simon Praetorius updated the commit message in patch set 2 11/18/24, 10:29

  2. Simon Praetorius updated the commit message in patch set 3 11/18/24, 10:29

  3. core-ci voted on patch set 1 V -1 11/18/24, 10:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69581

  4. core-ci voted on patch set 2 V -1 11/18/24, 10:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69583

  5. core-ci voted on patch set 3 V -1 11/18/24, 10:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69584

  6. Simon Praetorius uploaded patch set 4 V -1 11/18/24, 10:55

  7. core-ci voted on patch set 4 V +1 11/18/24, 11:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69587

  8. Simon Schaufelberger voted on patch set 4 CR +1 V +1 11/18/24, 11:48

  9. Garvin Hicking voted on patch set 4 CR +1 V +1 11/18/24, 17:44

  10. Christian Kuhn commented on patch set 4 CR -1 11/18/24, 19:37

    FluidViewAdapter.php:51

    we should test if "whatever is returned" can be turned into string, and if not, throw ... \RuntimeException most likely?!
  11. Christian Kuhn uploaded patch set 5 CR +1 V +1 11/18/24, 19:49

  12. core-ci voted on patch set 5 V -1 11/18/24, 19:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69619

  13. Simon Praetorius uploaded patch set 6 V -1 11/18/24, 21:54

  14. core-ci voted on patch set 6 V -1 11/18/24, 22:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69630

  15. Simon Praetorius uploaded patch set 7 V -1 11/19/24, 09:24

  16. Simon Praetorius uploaded patch set 8 11/19/24, 09:31

  17. core-ci voted on patch set 7 V -1 11/19/24, 09:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69674

  18. Simon Praetorius uploaded patch set 9 11/19/24, 09:33

  19. core-ci voted on patch set 8 V -1 11/19/24, 09:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69676

  20. core-ci voted on patch set 9 V +1 11/19/24, 09:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69677

  21. Simon Schaufelberger commented on patch set 9 CR +1 V +1 11/19/24, 10:57

    FluidViewAdapter.php:51 Reply

    Done
  22. Christian Kuhn voted on patch set 9 CR +1 V +1 11/19/24, 11:00

  23. Garvin Hicking voted on patch set 9 CR +1 V +1 11/19/24, 11:01

  24. Simon Praetorius voted on patch set 9 CR +2 V +2 11/19/24, 11:47

  25. Simon Praetorius merged patch set 10 11/19/24, 12:07