Fluid icon indicating copy to clipboard operation
Fluid copied to clipboard

f:replace: A stringable value must be provided.

Open linawolf opened this issue 1 month ago • 0 comments

When the text in which I want to make replacements is empty for some reason


    <f:format.html><f:replace search="{search}" replace="{replace}">{text.textAfter}</f:replace></f:format.html>

I get the following error:

(1/1) #1710441987 InvalidArgumentException
A stringable value must be provided.

in /var/www/html/vendor/typo3fluid/fluid/src/ViewHelpers/ReplaceViewHelper.php line 71
        $value = $this->arguments['value'] ?? $this->renderChildren();
        $search = $this->arguments['search'];
        $replace = $this->arguments['replace'];
        if ($value === null || (!is_scalar($value) && !$value instanceof \Stringable)) {
            throw new \InvalidArgumentException('A stringable value must be provided.', 1710441987);
        }
        if ($search === null) {
            if (!is_iterable($replace)) {
                throw new \InvalidArgumentException(sprintf(

I would expect to just get an empty string as a result (TYPO3 13.4)

linawolf avatar Dec 11 '25 06:12 linawolf