I ran into some trouble where I would add conditional settings to a field, then go into the form display settings and make changes to the same field. After updating the field display widget settings and then saving the form, the conditional fields would be cleared out.
For example for a 'page' type node, I would add a conditional field at admin/structure/conditional_fields/node/page, then modify the same field at admin/structure/types/manage/page/form-display and lose the conditional field setting that I just added.
The conditional fields are originally saved as third party settings on the field display widget but it looks like in Drupal\field_ui\FormEntityDisplayFormBase->copyFormValuesToEntity the third_party_settings also have to be added to the field display widget form in order to continue to exist after saving the field widget settings through the ui.
This was happening to me across different field widget types, entity types and web sites.
Comment | File | Size | Author |
---|---|---|---|
#2 | disappearing-settings-2902580-1.patch | 1.19 KB | kleinmp |
Comments
Comment #2
kleinmp CreditAttribution: kleinmp commentedHere's a patch that adds the conditional field settings as settings in the field display widget settings. They don't show up if there aren't andy and they're added as type 'value' so the user won't be editing them at this spot in the ui.
Comment #3
sheise CreditAttribution: sheise commentedThe patch worked great for me.
Comment #5
colanThanks! All I did was move the comment to the function header.
Comment #6
kleinmp CreditAttribution: kleinmp at Zivtech commented