Bug #33551

View helper values break out of a partial scope

Added by Stephan Schuler over 10 years ago. Updated almost 9 years ago.

Status:
New
Priority:
Must have
Category:
Core
Target version:
-
Start date:
2012-01-31
Due date:
% Done:

0%

Estimated time:
Has patch:
No

Description

If a partial is called at least twice which has a certain view helper inside, the last occurence of the inside value breaks out of the partials scope and will be the result of all usages of this view helper from now on.

This only appears when the first call triggers the caching mechanism but executes the uncached template (AbstractTemplateView::render() $parsedTemplate is instance of "TYPO3\Fluid\Core\Parser\ParsingState").
As soon as the template is a compiled one (AbstractTemplateView::render() $parsedTemplate is instance of "TYPO3\Fluid\Core\Compiler\AbstractCompiledTemplate"), the result is as expected.

Main template:

<html>
    <head>
        <title>Little bug</title>
    </head>
    <body>
        <ol>
            <li><f:escape type="xml">I am pre partial</f:escape></li>
            <f:render partial="Demo" arguments="{value: 'I am the first node within a partial'}" />
            <f:render partial="Demo" arguments="{value: 'I am not the first but the second node within a partial'}" />
            <li><f:escape type="xml">I am post partial</f:escape></li>
        </ol>
    </body>
</html>

Demo-Partial:

<li><f:escape type="xml">{value}</f:escape></li>

The expected result would be:

1. I am pre partial
2. I am the first node within a partial
3. I am not the first but the second node within a partial
4. I am post partial

But the given result is:

1. I am pre partial
2. I am the first node within a partial
3. I am not the first but the second node within a partial
4. I am not the first but the second node within a partial


Related issues

Related to TYPO3.Fluid - Bug #47674: HtmlentitiesViewHelper is scope singletonResolvedAlexander Berl2013-04-28

Actions

Also available in: Atom PDF