Bug #61965
closed
f:if viewhelper always returns <f:else> element content if no <f:then> element is specified
Added by most wanted over 9 years ago.
Updated over 9 years ago.
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.
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.
- Assignee set to Frank Nägler
- 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
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>
- 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!
Also available in: Atom
PDF