Closed (fixed)
Project:
Role Delegation
Version:
7.x-1.0
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
11 Jun 2011 at 19:17 UTC
Updated:
28 Jun 2011 at 01:51 UTC
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
Comment #1
Andrew Schulman commentedThanks 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.
Comment #2
Andrew Schulman commentedThis 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.
Comment #3
MrPhilbert commentedThank 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