Review 13.4 Merged

87087[BUGFIX] Cast tag-content of several ViewHelpers to string

Garvin Hicking CR +2 V +2 Hard +414 −19 updated 11/19/24, 19:57

Commit message

Several Fluid ViewHelpers used the method:

```
$this->tag->setContent($this->renderChildren());
```

However, in many cases specifying an integer as a tag content (for
example in pagination cases) is valid:

```
<f:for each="{1:'step1', 2:'step2'}"
       as='i'
       iteration='iterator'
       key="k">
    <f:link.action action="{i}">{k}</f:link.action>
</f:for>
```

This would lead to an exception, because the `setContent()` method
expects a a string.

Several ViewHelpers have now been adapted to cast the result of
`renderChildren` to a string.

Tests verifying this behaviour are added. Some cases where ViewHelpers
already had string-casting in effect are now secured with a test, too.

Notable exemptions of ViewHelpers where no string casting has been
applied:

- EXT:form VHs already seem to take care of proper renderChildren()
  handling.
- f:uri.action and f:uri.page do not accept tag based content.
- ce:link.clickEnlarge, sg:example, sg:code, sg:colorscheme do
  not make sense to receive non-string input, exceptions still

Note that for <dashboard:widget.button> no functional test exists yet,
and is beyond scope of this patch to be added.

Drive-by fix of adding (string) cast to an integer-based
'title' attribute for <f:be.infobox> added as well.

Review

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

Issues 1

Files 40

Show 20 more files

Review log 46

  1. Garvin Hicking commented on patch set 1 11/19/24, 16:49

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V +1 11/19/24, 16:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69725

  3. Garvin Hicking updated the commit message in patch set 2 V +1 11/19/24, 17:50

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

  5. Garvin Hicking voted on patch set 2 CR +2 V +2 11/19/24, 19:57

  6. Garvin Hicking merged patch set 3 11/19/24, 19:57