Download & Extend

Roles named not-in-English does not displayed on permissions page.

Project:Role Delegation
Version:6.x-1.x-dev
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

If I create some role named in Ukranian or Russian language ( UTF-8 codepage ), then Permissions page does not display such roles.
Tested on Windows apache 1.3, and on CentOS apache 2.

Comments

#1

I have discovered the same problem. What happens is that on non-english sites, on the permissions page, these are the only two options:

assign role
assign all roles

The reason for this is in this code:

<?php
function _role_delegation_make_perm($role) {
 
// Allow alphanumerics, space, hyphen, underscore.
 
$role = preg_replace('/[^a-zA-Z0-9 \\-_]/', '', $role);
  return
"assign $role role";
}
?>

The preg_replace function is replacing all roles that use non-English characters (in the OP's case, Russian, in my case, Japanese). I'm not to sure what the reason behind the preg_replace is, but I have found that by removing that line of code, the module works fine in other languages.

#2

Status:active» fixed

I think the preg_replace() was a leftover from Drupal 5, which had limitations on role names. Fixed!

To complete the upgrade, it will be necessary to run update.php in order to preserve the role delegation permissions.

#3

Status:fixed» closed (fixed)

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

nobody click here