Is there a way to hide a fieldset for a role if all the fields within that fieldset are hidden for that role? It may seem trivial, but when users are viewing or editing a node and an empty fieldset is visable, it is rather confusing. Where would I look for this in the code and does it refer more to CCK then to worflow_fields? Thanks

Comments

infojunkie’s picture

Thanks for your suggestion.

If you want to take a look at the code yourself, the function workflow_fields_node_form_alter() is the one in charge of showing the node form with the altered fields, and workflow_fields_nodeapi() handles the node view page.

mshaver’s picture

This actually already works for the node display, as the "fieldgroup.module" weight is set to 9, after the "workflow_fields.module" is called and has the hook _nodeapi() that hides the group if the fields are empty or not accessible?

Where it doesn't work is on node edit, the group is still visible if all fields are not accessible within the group for that role. The fieldgroup_form_alter() seems like it would take care of this as well, but it doesn't for some reason?

infojunkie’s picture

Assigned: Unassigned » infojunkie
Category: feature » bug

I confirmed that this is indeed a bug when fields are inside a fieldset. The fields are not found by workflow_fields which removes them from the database, thinking they've been deleted from the content type.

deekayen’s picture

Also related if not duplicate: http://drupal.org/node/159099

deekayen’s picture

There might be an answer to this in 6.x: http://drupal.org/node/277101

nath’s picture

Any solution for the 5.x version?

infojunkie’s picture

That's not high on my priority list, especially that D6 is maturing. You're welcome to submit a patch :-)

I'll check whether this bug also affects D6 since I'm not sure it is just a problem of rendering or a deeper one.

adnansyed’s picture

I also want to remove an empty Group fieldset box at the bottom of my registration form even though I have selected all groups to be private and made sure that the option "display on registration form" is unchecked.

Does anybody know how to fix this?

infojunkie’s picture

Status: Active » Closed (fixed)

This should be fixed in D6. Closing this unless someone still needs it on D5.

sopia’s picture

I'm having this problem too. Did you ever figure out how to get rid of the empty "Groups" fieldset?

Thanks for any help.