Bug #4051

TagBuilder is not resetted when a view helper is initialized multiple times

Added by Bastian Waidelich about 13 years ago. Updated almost 12 years ago.

Must have
Target version:
Start date:
Due date:
% Done:


Estimated time:
Has patch:


Since r2895 ViewHelpers that belong to the same ViewHelperNode (inside loops) are only instantiated once. This leads to the side-effect, that $this->tag points to the same reference.
If a tag attribute is set it won't be resetted when initialize() is called.


<f:for each="{0:1, 1:2, 2:3, 3:4}" as="foo">
    <f:link.action class="{f:if('odd' condition='{foo} % 2')}">{foo}</f:link.action>

Expected result:

<a class="odd" href="viewhelpertest/standard">1</a>
<a href="viewhelpertest/standard">2</a>
<a class="odd" href="viewhelpertest/standard">3</a>
<a href="viewhelpertest/standard">4</a>

Actual result:

<a class="odd" href="viewhelpertest/standard">1</a>
<a class="odd" href="viewhelpertest/standard">2</a>
<a class="odd" href="viewhelpertest/standard">3</a>
<a class="odd" href="viewhelpertest/standard">4</a>

Reset TagBuilder instance in initialize()

And we should check, whether there are more side-effects!


4051.patch (3.62 KB) 4051.patch Bastian Waidelich, 2009-07-29 14:01

Related issues

Related to TYPO3.Fluid - Bug #3994: Viewhelpers are instanciated multiple times in ViewHelperNodeResolvedSebastian Kurfuerst2009-07-27


Updated by Bastian Waidelich about 13 years ago

  • File 4051.patch 4051.patch added
  • Status changed from New to Needs Feedback
  • Assignee set to Robert Lemke

The attached patch fixes the issue for me.
Robert Lemke: Please have a look and commit if there are no objections


Updated by Robert Lemke about 13 years ago

  • Target version set to 1.0.0 alpha 3

Updated by Bastian Waidelich almost 13 years ago

  • Assignee changed from Robert Lemke to Bastian Waidelich

Updated by Bastian Waidelich almost 13 years ago

  • Status changed from Needs Feedback to Resolved
  • % Done changed from 0 to 100

Applied in changeset r3119.


Updated by Robert Lemke almost 13 years ago

  • Target version changed from 1.0.0 alpha 3 to 1.0.0 alpha 4

Also available in: Atom PDF