verbb / formie

The most user-friendly forms plugin for Craft CMS.
Other
93 stars 69 forks source link

Issue with nested conditions #1855

Closed Megafry closed 1 month ago

Megafry commented 2 months ago

Describe the bug

The conditions don't work properly with nested fields. I'm not sure how easily this can be fixed. please follow the steps to reproduce it.

Steps to reproduce

  1. Import the example JSON formie-colors.json
  2. Check the option red and then green.
  3. The group with the condition (color is red) is now visible and also the child element with the condition (green is checked)
  4. The group with the condition (green is checked) is also visible but not the child element with the condition (color is red)
  5. Click the option red, now the child element red is visible
  6. The opposite happens if the order of action is reversed.

Form settings

Craft CMS version

4.8.10

Plugin version

2.1.13

Multi-site?

No

Additional context

No response

engram-design commented 1 month ago

I see the issue here, and it's because we don't evaluate all conditions for the entire form anytime anything has conditions on it. But then you run into these issues where the fields inside a Group field do need to be evaluated along with their parent.

Fixed for the next release. To get this early, run composer require verbb/formie:"dev-craft-4 as 2.1.13".

engram-design commented 1 month ago

Updated in 2.1.14