Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Can't save group settings when using another module that saves extra information, such as display suite or panelizer.
You can create a new field group, but can't drag other fields inside the new field group to make a hierarchy.
To reproduce:
1) Install field_group dev version.
2) Install display_suite.
3) Create a new field_group for a content type in any display mode.
4) Drag another field inside the new field group with table drag.
5) Click save
6) Notice the other field isn't inside the field group
Comment | File | Size | Author |
---|---|---|---|
#3 | field_group-cant-save-field-group-2687185-10968001-D8.patch | 2.67 KB | mas5d2 |
Comments
Comment #2
mas5d2 CreditAttribution: mas5d2 commentedThis looks like it's a problem with the way field_group is saving the display settings for the field_group. field_group_group_save() is being called in field_group_field_overview_submit(). field_group_group_save loads the EntityDisplayInterface, makes changes, and saves it. This works great.
Any module that has a submit handler after field_group does this though, appears to be loading the EntityDisplayInterface from the $form itself, making changes, and saving. Since field_group doesn't use the existing instance of EntityDisplayInterface, but instead loads a new instance, it's not saving it's changes on this current instance that the other submit handlers are working with.
This existing instance is then being saved, which overwrites anything that field_groups has already saved.
Comment #3
mas5d2 CreditAttribution: mas5d2 commentedAdded $display as an optional parameter to field_group_group_save and updated field_group_field_overview_submit to pass it correctly. This should fix the issue.
Comment #4
mas5d2 CreditAttribution: mas5d2 commentedComment #5
artreaktor CreditAttribution: artreaktor as a volunteer and commented#3 fixed the issue for me. My setup is Display Suit + Field Collection
Comment #7
nils.destoop CreditAttribution: nils.destoop as a volunteer and at Wunder commentedThx for the patch. Tested it and committed to dev.
Comment #10
aspilicious CreditAttribution: aspilicious commented