Issue Bug Closed

#84543TS condition [globalVar = LIT:0 = 0] is not true

Markus Klein 03/27/18, 21:46 updated 10/02/18, 10:51

Description

Using a typoscript condition like `[globalVar = LIT:0 = {$someConst}]` never evaluates to true.

The reason is that the internal processing of LIT:0 results in a null value for the left side of the comparison.
This causes an evaluation of if (null '0')@, which is by definition [1] @false@.
(mind that @if (null 0)
would result in true)

[1] http://php.net/manual/en/types.comparisons.php

The solution is to correctly evaluate LIT:0 to be '0'.

How to test:

[globalVar = LIT:0 = 0]
page.30 = TEXT
page.30.value = never shown
[end]

Reviews 2