Review main Merged

90998[TASK] Avoid unintentional null values passed to TagBuilder

Simon Praetorius CR +2 V +2 Easy +2 −2 updated 10/14/25, 16:50

Commit message

With Fluid 5, the behavior of `null` values passed to the `TagBuilder`
will change: Before, `null` was converted to string and thus lead to an
empty tag attribute. With Fluid 5, the attribute will be omitted
altogether.

While this is unproblematic in most circumstances, for the `alt`
attribute of image tags it isn't. Both `ImageViewHelper` and
`MediaViewHelper` are adjusted to always pass a string to that
attribute, which ensures that it will always be present on the resulting
`<img>`.

Review

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

Issues 1

Files 2

Review log 89

  1. Simon Praetorius uploaded patch set 1 10/10/25, 13:35

  2. core-ci voted on patch set 1 V +1 10/10/25, 13:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86408

  3. Garvin Hicking voted on patch set 1 CR +1 V +1 10/10/25, 14:23

  4. Oli Bartsch commented on patch set 1 10/10/25, 14:45

    Do we know of further attributes where this is relevant?
  5. Christian Kuhn voted on patch set 1 CR +1 V +1 10/10/25, 15:19

  6. Simon Praetorius commented on patch set 1 10/10/25, 16:38

    Reply

    Some tests also failed for empty height/width attributes, which occurred if an image cannot be processed. Before it was width="", with Fluid the attribute will be gone. Which is fine I think. There were also failed test cases where form elements had null as value, which is also omitted with Fluid 5. I think that‘s also fine and doesn‘t need special attention. WDYT?
  7. Simon Praetorius voted on patch set 1 CR +2 V +2 10/14/25, 16:48

  8. Simon Praetorius merged patch set 2 10/14/25, 16:48

  9. Simon Praetorius commented on patch set 2 10/14/25, 16:50

    Reply Unresolved

    Hope it's ok that I merged this now since the comment doesn't affect the fixes themselves. No matter what we do, this will come up once Fluid 5 gets integrated: Either the VHs need to be adjusted or the tests.