- Issue created by @richgerdes
- last update
over 1 year ago 1 pass - @richgerdes opened merge request.
- Status changed to Needs review
over 1 year ago 3:47pm 22 May 2023 - πΊπΈUnited States richgerdes New Jersey, USA
I've opened an MR with a fix for this. This processed the default value on save to ensure that the value is checked for the existence of the "conditions" key. If the key isn't found, then the module will nest the value under the key. This is also written in a way that supports any modules which might want to extend this field type and add additional properties.
-
nagy.balint β
committed b8381cb7 on 2.0.x authored by
richgerdes β
Issue #3361903 by richgerdes: Field value is not set properly when using...
-
nagy.balint β
committed b8381cb7 on 2.0.x authored by
richgerdes β
- Status changed to Fixed
over 1 year ago 10:41am 23 May 2023 - ππΊHungary nagy.balint
Thanks!
It is a good question though why the setValue works differently for a base field than normal field.
@richgerdes
In the Announcements module's base field definitions:
at $fields['region'] the type should likely be 'options_select' as the 'options' does not exist for me at least, so if the manage form display is saved, it will throw an error if inline entity form is installed and that will be selected by default as the first item.and likely visibility should have the type "'type' => 'condition_field_default'," instead of 'q'
- πΊπΈUnited States richgerdes New Jersey, USA
@nagy.balint, thanks for the quick review.
I'm not 100% sure the bug here is the fault of the condition_field module itself. Seems like some odd behavior in core that isn't mapping columns the database to field properties well. I probably will dig into it further, but i think our use case here is pretty unique. I suspect that its rare an array is the only property in a base field, which is why the existing core code didn't handle it.
Also thanks for the code review on the module and going above and beyond. I had been meaning to fix the form settings, but kept forgetting. Should be fixed now. Thanks for testing it out!
Automatically closed - issue fixed for 2 weeks with no activity.