Project

General

Profile

Actions

Bug #91174

closed

if-viewhelper condition 0="text"

Added by Roman Büchler over 4 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2020-04-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The following condition seems to evaluate wrongly:

<f:debug>Result from condition '0 == "text"': {f:if(condition: '0 == "text"', then: 1, else: 0)}</f:debug>

The result is:

Result from condition '0 == "text"': 1

This might be hard to debug in case the test is against a variable that is of type integer or string:

{f:if(condition: '{test} == "text"',

When type casting it works as expected:

{f:if(condition: '{test as string} == "text"',

If in the above example test=1 then the condition doesn't pass. Without type casting it passes.

Actions

Also available in: Atom PDF