Child fields moved from disabled groups retain parent relationship

Created on 30 July 2025, 9 days ago

Problem/Motivation

When a field group is disabled (moved to hidden region) and contains child fields, moving those child fields to the enabled section (content region) does not properly update the parent-child relationship. The field appears visually in the enabled section, but programmatically still has the disabled group as its parent.

Steps to reproduce

Proposed resolution

The issue is in the field_group_field_overview_submit() function in includes/field_ui.inc. The submit handler only updates groups that are present in the form state ($field_group_form_state), but disabled groups are not included in the form state.

The fix ensures that all groups have their children array updated, regardless of whether they're in the form state or not:

  • Always update the children array for every group based on current form values
  • Only update other properties (label, parent_name, weight, region, etc.) for groups that are actually in the form state
  • This ensures parent-child relationships are always consistent between visual display and stored configuration

The key change is moving the $group->children = array_keys($children[$group_name]); line outside the form state check, so it executes for all groups, not just those in the form state.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

4.0

Component

Miscellaneous

Created by

🇩🇪Germany Grevil

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024