Project

General

Profile

Actions

Bug #77161

closed

Fluid - IfViewHelper does not work correct in Loop/Partial

Added by Peter Benke over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2016-07-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi together,

IfViewHelper does not work correct in Loop/Partial:

ViewHelper:

/**
 * Check Rendering
 * @param string $testmode
 * @return string
 */
public function render($testmode) {

    if($testmode == 'then'){
        return $this->renderThenChild();
    }else{
        return $this->renderElseChild();
    }

}

Template:

<f:for each="{fluidtests}" as="fluidtest" iteration="iteration">

    <vh:childRendering testmode="then">
        <f:then>
            <span style="color:green">Inside Template: Then...</span><br>
        </f:then>
        <f:else>
            <span style="color:red">Inside Template: Else...</span><br>
        </f:else>
    </vh:childRendering>

    <f:render partial="Single" />

</f:for>

Partial:

<vh:childRendering testmode="then">
    <f:then>
        <span style="color:green">Inside Partial: Then...</span><br>
    </f:then>
    <f:else>
        <span style="color:red">Inside Partial: Else...</span><br>
    </f:else>
</vh:childRendering>
<hr>

Output:

Inside Template: Then...
Inside Partial: Then...

Inside Template: Then...
Inside Partial: Else...

Inside Template: Then...
Inside Partial: Else...

This is not correct (Inside Partial: Else...).
It should always be: "Inside Partial: Then..."

Seems, that there is a bug, if I have a partial inside a loop.

See attached Test-Extension.

Thank you.


Files

fluid_test.zip (514 KB) fluid_test.zip Peter Benke, 2016-07-20 09:44
Actions

Also available in: Atom PDF