Project

General

Profile

Actions

Bug #90768

closed

Flexform nested displayCond

Added by Alexander König about 4 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-03-16
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
flexform condition displaycond
Complexity:
Is Regression:
Sprint Focus:

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?


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #82499: displayCond - Problem with multiple conditionsClosed2017-09-17

Actions
Actions #1

Updated by Alexander König about 4 years ago

  • Subject changed from Flexform nested conditions to Flexform nested displayCond
Actions #2

Updated by Georg Ringer about 4 years ago

  • Related to Bug #82499: displayCond - Problem with multiple conditions added
Actions #3

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
Actions #4

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

Actions #5

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

Actions #6

Updated by Jonas Eberle over 3 years ago

So could we close this?

Actions #7

Updated by Alexander König over 3 years ago

Yes, this issue can be closed.

Actions #8

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.

Actions

Also available in: Atom PDF