Currently, in the help paragraph at the top of ?q=admin/user/roles, we get a sentence that reads:
Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in <a href="/drupalhead/?q=admin/user/access/permissions">user permissions</a>
The link is buggy. The callback for q=admin/user/access is function user_admin_perm($rid). The menu hook supplies arg(3) as the parameter (i.e., the $rid) to this function. From the code in this function, its clear that this parameter should be a numeric role id. Because the string, 'permissions', is passed as the role id in this buggy link, the queries return nothing and you end up w/ an access control form w/ no role and no checkboxes for a role (but still a 'Save permissions' button at the bottom).
I'm not sure what the Drupal core conventions are but this patch both changes the link to take you to the access control page for all roles, and changes the function, user_admin_perm(), to do a couple of is_numeric() checks on the $rid parameter. It may be enough to just correct the link and not have the is_numeric checks. I'll leave this to the judgement of the committers.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | roles_numeric_0.patch | 1.6 KB | ChrisKennedy |
| #1 | roles_numeric.patch | 938 bytes | ChrisKennedy |
| user.module_63.patch | 1.62 KB | ankur |
Comments
Comment #1
ChrisKennedy commentedGood catch - confirmed that this is still an issue and definitely needs to be fixed. Re-rolled against cvs and with $rid && is_numeric($rid) condensed into is_numeric($rid). With the is_numeric changes the link works correctly and is restored in this patch.
The commit which caused the problem: http://cvs.drupal.org/viewcvs/drupal/drupal/modules/user/user.module?r1=...
Comment #2
dries commentedIt's probably cleaner not to overload URLs like that, but this patch works for me.
Comment #3
ChrisKennedy commentedRevised patch also updates link to the correct one: admin/user/access
Comment #4
Steven commentedCommitted to HEAD, thanks.
Comment #5
(not verified) commented