Bug #90768
closedFlexform nested displayCond
0%
Description
Hi,
we've got an issue with nested flexform conditions, this issue is also descriped in this https://forge.typo3.org/issues/82499 bugreport.
We want to use this nested condition:
<OR>
<AND>
<numindex index="0">FIELD:general.settings.flexForm.progMode:=:showEducationList</numindex>
<numindex index="1">FIELD:settings.flexForm.orgUid:REQ:false</numindex>
</AND>
<AND>
<numindex index="0">FIELD:settings.flexForm.progMode:=:showEducation</numindex>
<numindex index="1">FIELD:settings.flexForm.eduOrgUid:REQ:false</numindex>
</AND>
</OR>
Only the second "AND"-Block is evaluated, since this one will overwrite the first AND-block, when its pared into an array (info from linked bugreport).
Is there an other way to write this condition?
Updated by Alexander König about 4 years ago
- Subject changed from Flexform nested conditions to Flexform nested displayCond
Updated by Georg Ringer about 4 years ago
- Related to Bug #82499: displayCond - Problem with multiple conditions added
Updated by Georg Ringer about 4 years ago
- Status changed from New to Accepted
- Target version set to next-patchlevel
- Tags set to flexform condition displaycond
Updated by Harald Witt about 4 years ago
Hi,
wrapping the <AND>s inside the <OR> with a <numindex> solves the problem for now.
<displayCond> <OR> <numindex index="0"> <AND> <numindex index="0">FIELD:general.settings.flexForm.progMode:=:showEducationList</numindex> <numindex index="1">FIELD:general.settings.flexForm.orgUid:REQ:false</numindex> </AND> </numindex> <numindex index="1"> <AND> <numindex index="0">FIELD:general.settings.flexForm.progMode:=:showEducation</numindex> <numindex index="1">FIELD:general.settings.flexForm.eduOrgUid:REQ:false</numindex> </AND> </numindex> </OR> </displayCond>
This also works with other nested condition-constructs like:
<displayCond> <OR> <numindex index="0">FIELD:whatever:IN:1,3,7</numindex> <numindex index="1"> <AND> <numindex index="0">FIELD:general.settings.flexForm.progMode:=:showEducation</numindex> <numindex index="1">FIELD:general.settings.flexForm.eduOrgUid:REQ:false</numindex> </AND> </numindex> </OR> </displayCond>
Greeings
Harald
Updated by Harald Witt about 4 years ago
It's not a bug - it's a feature :-)
Hi, it's me again.
I think that Alexanders assumption (the second <AND> overwrites the first) is absolutely right. You ask me why?
The reason is, that every entry in a data-structure has always to be unique! Think about the <items>-array in a "select" inside TCA or flexform.
Thinking so, my purposed solution is NOT a workaround, but the normal case. And the bug is not a bug - it's a feature instead.
The only missing thing would be a better documentation with complex examples as above.
Greeetings
Harald
Updated by Riccardo De Contardi almost 2 years ago
- Status changed from Accepted to Closed
- Target version deleted (
next-patchlevel)
@Alexander König Thank you for your feedback and sorry for the very very late reply;
I close this issue in agreement with the reporter.
If you think that this is the wrong decision or I have misunderstood or there is still work to be done, please reopen it or open a new issue with a reference to this one.
Thank you.