Using 8.x-3.0-beta1 empty fieldgroups are hidden in forms (as expected), but when I upgrade to the current 8.x-3.x they show.

Comments

chrisolof created an issue. See original summary.

chrisolof’s picture

Title: Empty fieldgroups are showing » Empty fieldgroups are showing in forms
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new901 bytes

Swapped Element::children for Element::getVisibleChildren in field_group_remove_empty_form_groups() and the empties are gone.

Needs review.

alex.bukach’s picture

Worked like a charm! Thanks @chrisolof!

RTBC+1

  • zuuperman committed 19c2573 on 8.x-3.x authored by chrisolof
    Issue #2986455 by chrisolof: Empty fieldgroups are showing in forms
    
nils.destoop’s picture

Status: Needs review » Fixed

Thx for the patch, I committed it to dev

Status: Fixed » Closed (fixed)

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

w01f’s picture

Just updating this - using field group 3.x-dev with this patch and empty fieldgroups (from conditions applied via conditional fields) are still showing. Specifically, the tabs for the empty groups are still showing.

I've also attempted using the following patches without success:

liquidcms’s picture

I have a much newer version of dev: 8.x-3.0-rc2+1-dev (2019-Nov-20) which is still showing empty Fgs (no conditional fields involved): https://www.screencast.com/t/DJN8fI8Wt9AL

FG type is details sidebar

and i have comfimred the 1 line patch is in the code i have:

$children = Element::getVisibleChildren($element);

unfortunately i can't re-open this issue

liquidcms’s picture

I noticed that my empty FG also had a couple other (empty) FGs inside it. Once i removed those; the parent FG was hidden when empty.

So this should be considered as Needs Work (if anyone has access to change status).

mandclu’s picture

I'm not able to reopen the issue, so I created #3200703: Empty fieldgroups are showing in forms (updated). FWIW I tried changing the remaining places I could find Element::children in the code to Element::getVisibleChildren (at least where they were part of a conditional statement) but was not able to fix the issue.