Skip to content

f:replace: A stringable value must be provided. #1279

@linawolf

Description

@linawolf

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions