Using 7.x-1.5, create a content type with the following nested field groups and no fields:

  • Level A
    • Level B
  • Level 1
    • Level 2
      • Level 3

The node add/edit forms (and any VBO forms you create) will have a single empty fieldset called "Level 1".

It seems as though this module can only hide the two deepest levels in any given set of nested groups.

As far as I can tell, this is because _field_group_is_empty_element() returns TRUE whenever any child element has a #type set, even though that child might just be another empty field group.

I've tried using 7.x-1.x-dev instead but that actually makes things worse and shows all of the fieldsets.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

morbiD created an issue. See original summary.

morbiD’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
856 bytes

Hmm, shouldn't _field_group_is_empty_element() check if #access is FALSE before bothering to check the #type?

Here's a patch that seems to produce the correct behaviour in my use case. Not sure if it has any negative effects elsewhere though...

Chris Matthews’s picture

The patch in #2 to field_group.module applied cleanly to the latest field_group 7.x-1.x-dev, but still needs review.

marc.groth’s picture

Version: 7.x-1.x-dev » 8.x-3.x-dev
FileSize
1.22 KB

This is still occurring in the latest version on the 3.x branch. The empty fieldsets also show on the 'Scheduled Transitions' tab (when using the https://drupal.org/project/scheduled_transitions module).

Attached is a patch that fixes this behavior. Not sure if it's the best way to achieve this; but it does the job for nested fieldsets (up to 3 x nested from my testing).