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.

CommentFileSizeAuthor
#2 disappearing-settings-2902580-1.patch1.19 KBkleinmp
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kleinmp created an issue. See original summary.

kleinmp’s picture

Here'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.

sheise’s picture

Status: Active » Reviewed & tested by the community

The patch worked great for me.

  • colan committed f944efb on 8.x-1.x authored by kleinmp
    Issue #2902580 by kleinmp, colan: Saved field settings by implementing...
colan’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! All I did was move the comment to the function header.

kleinmp’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.