in previous versions of field_group if the fields contained were not editable - for example field permissions, the field group did not display during the content edit. after the update to 1.6 these field groups are now being displayed as empty field groups. for our case we're using vertical tabs with fields that have field permissions set to determine what roles can edit what fields - organized by the field_group vertical tabs.

this appears to be the result of the #2494385: Should #array_parents be updated in field_group_fields_nest()? patch. i have reverted this bit of code and the groups now behave as they did - not displayed unless the user has permission for a field contained within the field group. we rely on this behavior - probably because that's the way it has worked (and found a reference suggesting this approach 3+ years ago - #2153771: Field group visible based on Role / Permission? - so others may be depending upon this as a way to hide a group as well).

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marthasa created an issue. See original summary.

travelvc’s picture

I can confirm the same issue.

In my case, upgrading from 1.5 to 1.6 causes an erroneous tab to be displayed on my site registration page.

Reversing the patch in #2494385 that was included in the 1.6 update resolved the issue.

It looks like it's the new code in field_group_fields_nest() that is causing this.

I have attached a reverse patch in case anyone needs a quick fix.

sense-design’s picture

Patch works for me too and removes empty groups.

gturnbull’s picture

This patch worked for me too. After updating from version 1.5 to 1.6, field groups with non editable fields became visible. This resulted in a field group of empty vertical tabs appearing in the middle of our online checkout page.

Great patch! Thank you!

smitty’s picture

Patch works great! Thank you!

Anybody’s picture

Version: 7.x-1.6 » 7.x-1.x-dev

I can confirm that the issue exists in 1.6 and latest dev, while it was correct in 1.5. I'll change the version to 7.x-1.x-dev and hope for this to be commited to dev soon.

I'll test further now.

Anybody’s picture

Status: Active » Reviewed & tested by the community

RTBC. The patch works perfectly and restores the correct behaviour from 1.5

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: field_group-remove-array_parents-2494385-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Anybody’s picture

Status: Needs work » Reviewed & tested by the community
jyraya’s picture

Status: Reviewed & tested by the community » Needs work

Hello,

Fixing an issue by introducing a regression on another topic is just a workaround, but cannot be a definitive solution.
I put back the issue in "Needs work" waiting for a true fix that does not reintroduce the other issue.

I will work on this and hope coming back with a fix ASAP.

drumm’s picture

This caused #3010210: Blank tabs on the registration page on Drupal.org.

Reverting and re-opening the original issue would certainly be an okay solution here, since #2494385: Should #array_parents be updated in field_group_fields_nest()? was a feature request that cleanly reverts. But that’s up to the maintainers.

Attached is a patch with a narrow fix for this. I’m not sure if it’s ideal, but it’s straightforward and I can’t see any side-effects.

Status: Needs review » Needs work

The last submitted patch, 11: 2926605.patch, failed testing. View results

drumm’s picture

Status: Needs work » Needs review
FileSize
885 bytes

I’ve gotten out of the habit of using old array syntax.

ChrisDarke’s picture

Status: Needs review » Reviewed & tested by the community

RTBC patch #13, does exactly what is needed.

John Pitcairn’s picture

Component: Miscellaneous » Code

This regression also affects fieldgroups added to commerce checkout panes by the commerce_fieldgroup_panes module. See #3093815: Vertical tab fieldgroups are rendered when disabled. The patch at #13 fixes it.

John Pitcairn’s picture

muaz91’s picture

+1 for the patch in #13

PhilY’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Patch #13 works using Drupal 7.73, field_group 7.x-1.6 and PHP 7.2
Thanks

drumm’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

As far as I’m aware, the patch has not had final review and committing.

“Patch (to be ported)” really means that that it needs backporting to an earlier release series, like 6.x-1.x.

PhilY’s picture

I apologize for misunderstanding the meaning, thanks @drumm for checking and setting it back.

dmundra’s picture

Tested patch #13 and it worked for me as well.

anrikun’s picture

Issue tags: +Regression

Patch at #13 works for me as well. Please commit.

claudioasaez’s picture

+1 for the patch in #13

  • swentel committed 2e059f4 on 7.x-1.x
    Issue #2926605 by drumm, travelvc, claudioasaez: after update from 1.5...
swentel’s picture

Status: Reviewed & tested by the community » Fixed

committed and pushed, thanks!

swentel’s picture

Status: Fixed » Closed (fixed)