Actions
Bug #83812
closedFluid-If-Conditions with conjunctions not working for countables
Start date:
2018-02-08
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Description
Fluid-If-Conditions that evalutates empty countable-objects treat them as "true" when used in a conjunction (&& or ||). When evaluated alone, they are correctly evaluated to false.
This seems to be a small bug, but it has huge effects after we rolled out TYPO3 8.7.10 as we often use the inline-if-viewhelper to generate class-names.
It happens in fluid-templates like this:
<f:if condition="{canBeCounted} || {false}">
<f:then>
<p><strong>Wrong: empty canBeCounted or false evaluates to true</strong></p>
</f:then>
<f:else>
<p>Correct: empty canBeCounted or false evaluates to false</p>
</f:else>
</f:if>
<h2>Inline-Version</h2>
<p>canBeCounted or false: {f:if(condition:'{canBeCounted} || {false}',then:'<strong>Wrong: true</strong>',else:'Correct: false')}</p>
In both examples (inline and not inline) it happens. In 8.7.9 (and before) the inline-code worked correctly, but the not-inline-version also failed.
To easily reproduce this bug, I attached a small demo-extension that shows what is happening. The output looks like this to me:
In TYPO3 8.7.10:
In TYPO3 8.7.9:
Files
Actions