I have a number of profile fields grouped by a category. Using your excellent module I was able to restrict edit permissions on those fields to only the site administrator yet still allow the account to view (but not edit) the fields. However, on the account owner's edit screen, you can still see see the category name. Clicking on the name shows a blank screen with just a save button. Since all fields in the category are hidden from that role, I would think that the category itself should not show up on the edit screen.

Comments

boombatower’s picture

Hmm...thought it did that.

I'll look into it once I get settled in for Drupalcon. (depends on how things go)

boombatower’s picture

Hmm you are right it does not....the only clean way to do so would be to override menu access calls and check then, but if I do that it won't work with profile_role which I would prefer.

I could instead just display a message, "no visible items" or something...hmm I'll ponder it.

jsr47’s picture

There are some similar issues with this. The permissions options don't exactly make sense: you can have permission to edit but not view, which is not functional.

And as far as I can work out, there doesn't seem to be a away to be able to edit your *own* information but not see other user's, which is what I assumed was a primary goal of this module. At least, that was my goal in installing it - to have a user editable field the user could share with administrators but that no one else could see.

ilo’s picture

#3 jsr47, I'm not sure if this is a completely different issue, and as far as I know, setting the profile field to private in profile without additional modules would fit your requirements. Taking a look to the code in the devel version there are 'view own..' and 'edit own..' permission set that does exactly what you want. Do you mean these two permissions are not working?

About the original issue, we can change the 'Save' button if not editable fields are in the form. What do you think?

scotwith1t’s picture

just a bump...if every field in the category is not visible to the user, the tab is still there, the empty fieldset still shows with the legend visible....but you knew that per the above...any progress on this? thanks!

ilo’s picture

Phrancescot, figure the following case: Module A includes a field in the user profile form using hook_form_alter, the fieldset is removed by role_permission because we have hidden all the fields. The other module may a) fail because it will not see the fieldset and think that it is not the page the module is looking for, or b) put a field in the middle of nowhere just beacuse the fieldset is unset. Now think that these may also happend for whole category pages, not just a fieldset.

If you are able to find a solution to this, then we can get this fixed. I've thought that a checkbox in the settings somewhere may help the site admin to select when to remove the fieldsets and the category pages, so we are delegating this responsability to the site administrator.

Boombatower?

scotwith1t’s picture

Point taken. I'm no coder, so I'll leave that to you guys to figure out. I have a work-around for my particular use case (ugly, but hide with css conditionally based on a user's role works for me), but will keep an eye on this to see what happens anyway.

ilo’s picture

Coder or not, I'm pretty sure that your impression has a lot of sense. It also happens to me, I do have a group of fields completetly hidden right now, but I'm aware of one of the site custom modules verifying that a profile field exists and also perform some alterations in that form, so I guess I just found a blocker here due to a specific module combination (bad) luck.

As I said, some cases will find unsetting that form part a solution, others not, so perhaps this final step of form elements unsetting should be manually configurable by the site administrator in the end.

ilo’s picture

I'm still stucked in my project solving other issues and we haven't started to work on this yet, it has been delayed a pair of days more. Sorry.

boombatower’s picture

Status: Active » Closed (won't fix)

Had a discussion about this in irc with ilo and we agreed that this is too open ended/hackish for this module to implement in the variety of ways possible. The issue can be worked around by restructuring fields so that there is some sort of dummy field always displayed. If the category ends up totally empty there are too many open ends...just implement it the way you want for your site and call it a day.

Thanks to all who participated.