Project

General

Profile

Actions

Bug #105200

closed

TypeError in DebugViewHelper when title is integer

Added by Thomas Rawiel 4 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2024-10-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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']
        );

Actions #1

Updated by Garvin Hicking 4 months ago

  • Status changed from New to Needs Feedback

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

Actions #2

Updated by Gerrit Code Review about 1 month ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87424

Actions #3

Updated by Gerrit Code Review about 1 month ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87424

Actions #4

Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87537

Actions #5

Updated by Gerrit Code Review about 1 month ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87538

Actions #6

Updated by Benni Mack about 1 month ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF