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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ChrisKennedy’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
938 bytes

Good 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=...

Dries’s picture

It's probably cleaner not to overload URLs like that, but this patch works for me.

ChrisKennedy’s picture

FileSize
1.6 KB

Revised patch also updates link to the correct one: admin/user/access

Steven’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)