Project

General

Profile

Actions

Bug #84543

closed

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

Added by Markus Klein about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
TypoScript
Target version:
Start date:
2018-03-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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]
Actions #1

Updated by Gerrit Code Review about 6 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56464

Actions #2

Updated by Markus Klein about 6 years ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review about 6 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56474

Actions #4

Updated by Markus Klein about 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF