Issue Bug Closed

#102264 #1476107295 TYPO3\CMS\Core\Error\Exception PHP Warning: Array to string conversion in /var/www/html/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/Abs

Thomas Sam Wittich 10/26/23, 12:05 updated 04/28/24, 20:41

Description

Hi,
Exception throws at: /var/www/html/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/AbstractNode.php line 73
That means:

    {
        if (is_object($value) && !method_exists($value, '__toString')) {
            throw new Parser\Exception('Cannot cast object of type "' . get_class($value) . '" to string.', 1273753083);
        }
        $output = (string)$value;
        return $output;
    }

The line $output = (string)$value; throws it, but the error in mho is in the preceeding if statement: It’s asking for object, but not for an array. (Which is the case there).

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 1

History 5

  1. Garvin Hicking commented 10/26/23, 13:59

    Can you add info about from which fluid markup / operation this actually stems? A possible fix would involve testcases, so it would be good to know how it can be reproduced.

  2. Stefan Bürk commented 10/31/23, 11:11

    Created issue in the fluid repository for it:

    https://github.com/TYPO3/Fluid/issues/826

  3. Riccardo De Contardi commented 04/25/24, 18:18

    Is this issue still valid? Looking at https://github.com/TYPO3/Fluid/issues/826 I see it has been closed on Nov 21, 2023

  4. Thomas Sam Wittich commented 04/26/24, 07:42

    Hi Riccardo, thank you coming back to it. Should be closed.
    Thx, Thomas

  5. Riccardo De Contardi commented and changed status New Closed target version 04/28/24, 20:41

    @ Thomas Sam Wittich Thank you for your quick reply;

    Closing this issue in agreement with the reporter.

    If you think that this is the wrong decision or experience the issue again, please reopen it or open a new issue with a reference to this one.

    Thank you.