Scenario: I have a field group 'Admin info' in a content type that contains fields that are restricted via field permissions to admin users. With 1.1 this used to work thus: When an admin user viewed the content type they would see a field group 'Admin info' clearly marking the items that weren't to be shared with other users. The field group would disappear entirely for other users. This is in a non-form display.

Now with 1.2, anonymous users see the empty field group, which I've hidden to them temporarily via CSS. I could do this easily because my users are either admins or anonymous.

I thought that the problem might be something to do with upgrading, so I removed the field groups from my content types, then uninstalled field group and set it and the field groups up again from the beginning, but the end result is still the same.

I had a look at the field_group.module file for 1.2 and could see that the function field_group_remove_empty_display_groups() was the same as in 1.1, so I guess that the problem is being introduced elsewhere. Sorry, but I don't think that my coding skills are up to debugging this problem.

CommentFileSizeAuthor
#4 wiblet-display-2.jpg17.86 KBactivelink
#4 wiblet-display-1.jpg45.44 KBactivelink
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nils.destoop’s picture

Hmm, can't seem to reproduce this one.

I have following group: group_div. This is a collapisble div
In that group, i added a field, field_tags. I set custom field_permissions, only administrators can do something with the field.

When i login with my normal user, then the group is not shown.
When i give authenticated users access, then the group is shown again.

nils.destoop’s picture

nils.destoop’s picture

Status: Active » Closed (duplicate)
activelink’s picture

Status: Closed (duplicate) » Active
FileSize
45.44 KB
17.86 KB

Thanks for checking it, but it's not a duplicate of #2081217: Vertical tabs always appear when children elements have no access, as that is on forms while my issue is on a non-form display.

I can easily reproduce it, I installed a fresh 7.23 core, field_permissions, ctools, field_group, set up a content type wiblet with one text field, SKU, restricted to admins only.

Set up a display field set 'Admin info' containing the SKU field.

wiblet a

When viewing a wiblet node as anonymous, I see the empty 'Admin info' group. Field_group 1.1 would have hidden the empty group.

wiblet b

I'll see if I can hack it on my new test site, but I've reactivated my issue in the hope that someone can help, as I don't think that I fully understand the way the code in the module file works/interacts with core. If I can come up with a solution then I'll post it here.

activelink’s picture

I can't figure out why it's going wrong, but I did find that a genuinely empty (pointless) fieldset doesn't display, while one with no content by virtue of field_permissions does display.

I'm reverting to 1.1 which works flawlessly for my purposes.

nils.destoop’s picture

Ok, tested it on display side, and it was indeed broken. I committed a fix + a test for it to dev.

nils.destoop’s picture

Status: Active » Fixed
activelink’s picture

Tested. Works well, thank you.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Made clearer

  • Commit 15e00f1 on 7.x-1.x, 8.x-1.x by zuuperman:
    Issue #2084999 by activelink: Fixed Empty field groups aren't being...