spicywebau / craft-neo

A Matrix-like field type for Craft CMS that uses existing fields
Other
402 stars 63 forks source link

Conditional asset fields not saving values after switching condition #883

Closed TheFunkyMonk closed 5 months ago

TheFunkyMonk commented 5 months ago

Bug Description

Inside a Neo block, I have two asset fields with their visibility conditions set based on the value of a separate field (dropdown). When I have assets selected and saved in the default visible field, and I switch the dropdown to the secondary condition to display the other asset field, it shows correctly. But when I select assets and save the entry, the selection is missing (throwing a validation error for a required field). I have tested this with entry-level fields in the same configuration, but it seems to only be reproducible within a Neo block.

Steps to reproduce

  1. Create a dropdown field with two options
  2. Create two asset fields
  3. Add all fields to a Neo block's field layout with the visibility condition for each set to a certain value in the dropdown.
  4. Add a block, leave the dropdown at its default value, select an asset, save.
  5. Switch the dropdown to the other option, swapping out the asset field for the other.
  6. Select an asset and save.

Expected behaviour

Content for the newly visible field is saved.

Neo version

5.0.0-beta.6

Craft CMS version

5.0.5

What is the affected Neo field's propagation method?

No response

Does this issue involve templating, and if so, is eager-loading used?

This is not a templating issue

ttempleton commented 5 months ago

Thanks for reporting that - fixed now in 5.0.0-beta.7.