CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #37656

Multiple Conditions in IF-Template-Marker

Added by Timo Wiersch 12 months ago. Updated 11 months ago.

Status:Closed Start date:2012-05-31
Priority:Must have Due date:
Assignee:Reinhard Führicht % Done:

0%

Category:View
Target version:-
Votes: 0

Description

Hello,

there is an error in "multiple-conditions-markers"...

when using a Condition Marker like ###IF_field=value && field2=value2### it is always true if the second part (field2=value2) is true, no matter what the first part's result is.

By looking at the Tx_Formhandler_View_Form.php it becomes obvious that the conditions are correctly looped, but only one boolean is used "$conditionResult" to save the results, which is resetted in every loop and then overwritten by the current condition, so that always the last condition is relevant for the whole condition set, the first ones are ignored.

Please fix :)

Timo

History

Updated by Reinhard Führicht 12 months ago

  • Category set to View
  • Status changed from New to Needs Feedback
  • Assignee set to Reinhard Führicht
  • Target version set to v1.4

Which version of Formhandler are you referring to?

I have tested it with the current trunk and it worked fine:

###IF_message=asdf&&email=asdf###
AND condition is true
###IF_message=asdf&&email=asdf###

In the loop the result are "collected" in the variable $finalConditionResult.

if($count === 0) {
    $finalConditionResult = $conditionResult;
} elseif($operator === '&&') {
    $finalConditionResult = ($finalConditionResult && $conditionResult);
} elseif($operator === '||') {
    $finalConditionResult = ($finalConditionResult || $conditionResult);
} else {
    $finalConditionResult = $conditionResult;
}

Updated by Timo Wiersch 11 months ago

Hello,

i tested with Version 1.2.0...
i'm pretty sure i couldn't update to 1.3.0 then...
So it was fixed in 1.3.0?

If so, bug can be closed...

Updated by Reinhard Führicht 11 months ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (v1.4)

Yes, there have been changes in 1.3.0 which fix this problem.

Also available in: Atom PDF