- Issue created by @redneko
After updating to v4.0, one of the nested field groups on a node does not display even though it is not empty.
After reviewing the differences between v4.0.0 and v8.x-3.6, I found that the changes in Nested groups render on other entity forms (or when fields are inaccessible) when they shouldn't → were the cause.
The code loops through an array that starts with the fields, then groups. For each of them it checks if it's in the group list that was passed. If it is, it checks the $empty_groups_indication
array to see if that group is set as an empty element. In order for a group to not be an empty element, one of its children (field or group) needs to have come before it in the list. In the case of nested groups, if a group from the middle of the nest comes first, none of it's children will have set its $empty_groups_indication entry to false. Then, the next part of the code that would set its parent group to false (not empty) does not run field_group.module, line 1063
. That parent then is never set to not empty, causing it and its children not to be displayed
Example structure:
Tabs Group 1
--Child Group (Tab)
----Field
--Child Group (Tab) <--- At the end of the process this group considered empty, but it has children with fields
----Tabs Group 2 <--- After all the fields, this group is checked first. It's 2 child groups have not run yet, so it is treated as empty. The next bit of code to set the parent to not empty doesn't run.
------Child Group (Tab)
--------Field
--------Field
------Child Group (Tab)
--------Field
--------Field
--Child Group (Tab)
----Field
The order the field groups are processed in is determined by the array returned by Element::getVisibleChildren($element)
. Most of the time, it returns the children in an order that works with the process of marking groups as empty. Sometimes it does not.
Active
4.0
Miscellaneous