Project

General

Profile

Actions

Bug #61965

closed

f:if viewhelper always returns <f:else> element content if no <f:then> element is specified

Added by most wanted about 10 years ago. Updated about 10 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
Category:
Fluid
Target version:
Start date:
2014-09-30
Due date:
% Done:

0%

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

Description

This will incorrectly return "Foo" in TYPO3 CMS 4.5.

<f:if condition="1">
    <f:else>
        Foo
    </f:else>
</f:if>

Tested with TYPO3 CMS 4.5.34 and 4.5.37-dev.

TYPO3 CMS 6.2 will correctly return nothing here.

Actions #1

Updated by Frank Nägler about 10 years ago

Thanks for your reporting, I have found the problem or differences.
The method AbstractCondtionViewHelper::renderThenChild is different and renders in 4.5 the other children nodes if no "then"-node is available.

Actions #2

Updated by Frank Nägler about 10 years ago

  • Assignee set to Frank Nägler
Actions #3

Updated by Gerrit Code Review about 10 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_4-5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/33082

Actions #4

Updated by Frank Nägler about 10 years ago

Test cases:

    <f:if condition="1">
        <p>should be visible, because no f:then or f:else here </p>
    </f:if>
    <f:if condition="1">
        <f:then>
        <p>should be visible, because only one f:then here </p>
        </f:then>
    </f:if>
    <f:if condition="1">
        <f:else>
        <p>should NOT be visible, because no f:then and only one f:else here </p>
        </f:else>
    </f:if>
    <f:if condition="1">
        <f:then>
        <p>should be visible, because f:then and f:else here </p>
        </f:then>
        <f:else>
        <p>should NOT be visible, because f:then and f:else here </p>
        </f:else>
    </f:if>
    <f:if condition="0">
        <p>should NOT be visible, because no f:then or f:else here </p>
    </f:if>
    <f:if condition="0">
        <f:then>
        <p>should NOT be visible, because only one f:then here </p>
        </f:then>
    </f:if>
    <f:if condition="0">
        <f:else>
        <p>should be visible, because no f:then and only one f:else here </p>
        </f:else>
    </f:if>
    <f:if condition="0">
        <f:then>
        <p>should NOT be visible, because f:then and f:else here </p>
        </f:then>
        <f:else>
        <p>should be visible, because f:then and f:else here </p>
        </f:else>
    </f:if>
Actions #5

Updated by Frank Nägler about 10 years ago

  • Status changed from Under Review to Rejected

The patch is rejected, for the following reason:

Ernesto Baschny:
Although a good idea and a nice bug fix. But we are in the last phase of the 4.5 LTS life-cycle where we only include fixes for security or browser-compatibility. This does not qualify as an "important fix" by this definition, so please upgrade your projects to 6.2 to get the benefit of this improvement. Thanks for understanding!

Actions

Also available in: Atom PDF