Emptiness check in field_group_remove_empty_form_groups() does not account for empty containers

Created on 22 July 2019, over 5 years ago
Updated 20 June 2024, 8 months ago

Some modules manage entity field edit access with hook_field_widget_multivalue_form_alter() which involves the widget child level rather than container level.
Function field_group_remove_empty_form_groups() does not check for visibility of container childs.
If access should never be set on the field widget element child level, but only at the container level then this must be "Won't fix". But perhaps a case could be made for checking access at the widget level as well.

But maybe in this case you should just accept the container markup or deal with that yourself and accept that Field Group can not assume that container markup should just be thrown away, even if most of the time it will be just empty divs...

However, all this got me thinking: if a container has no visible children and the #optional property is set to TRUE, then I guess Field Group could actually deal with that.

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇳🇱Netherlands Eric_A

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024