User roles are configuration items, therefore they should use machine names as identifiers and not serial integers. This is important for the exportability of roles. There is the Role Export module for Drupal 7 that works around the integer identifier in a hackish way. Drupal 8 should be fixed to use role machine names only.
Change all occurrences of role ids (rid) in Drupal from integers to strings (machine names).
- A change record has to reviewed and improved: http://drupal.org/node/1619504
User interface changes
- When adding a new role a role ID machine name field has to be filled out also.
- The role id is displayed as machine name on the role edit page.
The user/account object changes regarding roles: The array keys of the roles array are not numeric role ids anymore but machine name strings. The human readable role name (label) is kept as array value for now. Old role system:
$user->roles = array( 2 => 'authenticated user', 3 => 'administrator', 4 => 'site editor', );
$user->roles = array( 'authenticated' => 'Authenticated user', 'administrator' => 'Administrator', 'site_editor' => 'Site editor', );
user_role_load_by_name() has been removed, as the role ID is the machine readable name now.
Original report by sun
Same as, for
PASSED: [[SimpleTest]]: [MySQL] 36,847 pass(es). View
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 935062-role-names-91.patch. Unable to apply patch. See the log in the details link for more information. View
PASSED: [[SimpleTest]]: [MySQL] 36,723 pass(es). View