Issue Bug Closed

#105200TypeError in DebugViewHelper when title is integer

Thomas Rawiel 10/04/24, 13:55 updated 12/02/25, 14:32

Description

*Summary:*
The TYPO3\CMS\Fluid\ViewHelpers\DebugViewHelper causes a Type Error in TYPO3\CMS\Extbase\Utility\DebuggerUtility, when the title is set, but is not a string.

*How to reproduce:*
For example add the viewhelper in any Fluid-Template

<f:debug title="{data.uid}">{_all}</f:debug>

results in TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(): Argument #2 ($title) must be of type ?string, int given, called in /var/www/html/vendor/typo3/cms-fluid/Classes/ViewHelpers/DebugViewHelper.php on line 90

Workaround:
Add a space or other chars to make it a string

<f:debug title=" {data.uid}">{_all}</f:debug>
<f:debug title="Uid: {data.uid}">{_all}</f:debug>

*Possible solution:*
Cast the value to string in the Viewhelper, for example:

return DebuggerUtility::var_dump(
            $renderChildrenClosure(),
            (string) $arguments['title'],
            $arguments['maxDepth'],
            $arguments['plainText'],
            $arguments['ansiColors'],
            $arguments['inline'],
            $arguments['blacklistedClassNames'],
            $arguments['blacklistedPropertyNames']
        );

Reviews 3

History 37

  1. Garvin Hicking commented and changed status New Needs Feedback 10/04/24, 19:06

    Sounds like a good solution, would you like to create a patch for it? :-)

  2. Gerrit Code Review pushed patch set 1 for main to change 87424 status Needs Feedback Under Review 12/10/24, 19:15

  3. Gerrit Code Review pushed patch set 2 for main to change 87424 12/11/24, 09:16

  4. Gerrit Code Review pushed patch set 1 for 13.4 to change 87537 12/17/24, 14:57

  5. Gerrit Code Review pushed patch set 1 for 12.4 to change 87538 12/17/24, 15:01

  6. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % 12/17/24, 15:25

    Applied in changeset commit:77e6589b220087d8d2c391bd4019e3bc3718f303.

  7. Benni Mack changed status Resolved Closed 12/02/25, 14:32