Project

General

Profile

Bug #91757

Updated by Karsten Nowak (undkonsorten) almost 4 years ago

Two or more conditions in a line are not evaluated correctly.  

 The documentation (https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/TypoScriptSyntax/Syntax/Conditions.html#the-syntax-of-conditions) says: 
 > …the line content gets broken down into smaller units ([ condition 1 ] and [ condition 2 ]) which are individually evaluated and connected by a logical OR before they return the resulting TRUE or FALSE value. 

 The AbstractConditionMatcher doesn't split multiple conditions. 
 They just remove the first '[' and the last ']'. Then the whole rest of the string are used to evaluate the expression. 

 Example:  

 <pre>[1 @[1 == 0] || [2 == 2]</pre> 2]@ 

 This results in checking of following expression 

 <pre>1 @1 == 0] || [2 == 2</pre> 2@ 

 Normally with the 2==2 the condition should be return "true". But it doesn't. 

 If I don't write the two @][@ 

 <pre>[1 @[1 == 0 || 2 == 2]</pre> 2]@ 

 the condition returns true if one of the conditions is true. 

 I'm not sure where is the bug. In documentation or in code. There are many examples with the wrong syntax if the bug is in the documentation.  

 I'm wondering that nobody else had the problem. I didn't found the problem on forge or in slack. Maybe I'm searching for the wrong keywords :-). 

Back