Role delegation shows up on every profile tab (not just the account tab).
Would it be possible to restrict the form output to user/#/edit instead of all profile pages? I know that if someone were to change path profiles in pathauto, it could break but maybe a simple warning would suffice?

Both of these modules are very useful but showing the Role Delegation form on only one tab would be very helpful.

Thanks.

Comments

Andrew Schulman’s picture

Title: Profile 2 » Role delegation options appear in every profile edit form with Profile 2
Assigned: Unassigned » Andrew Schulman

Thanks for reporting this. I agree that the role delegation options only belong in the Account tab of the user editing form, not in any of the other tabs, such as profiles.

I've committed a patch that fixes the problem in my testing. Please try the patch, or the next -dev release when it becomes available, and let me know if it works for you.

I haven't looked yet to see if this problem also occurs in D6. Also, the patch only fixed the user editing form, not the user registration form - I still need to look at that.

Andrew Schulman’s picture

Status: Active » Fixed

This problem doesn't occur in D6. In D7 it doesn't occur right now in the user registration form, since e.g. Profile 2 doesn't create additional tabs there. But to be sure, I added a test for the user registration form as well, so it will only show up in the main tab there.

I consider this problem fixed. The fix will go out in version 7.x-1.1, which will be released after one other patch goes in. If you think the problem isn't fixed yet, please feel free to reopen this report.

MrPhilbert’s picture

Thank you very much Andrew.

At first I tried to apply the patch but on the dev version. By the time I realized my mistake, you updated dev.
It works perfectly.

Your change is very elegant e.g.
if ($form_id == 'user_profile_form' && $form['#user_category'] != 'account') {
+ return;
+ }

$account = $form['#user'];
_role_delegation_add_roles_to_form($form, $account);

If not account tab return null is a lot better than relying on a path that could change.

Very cool!
Thanks again.
MrPhilbert

Status: Fixed » Closed (fixed)

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