diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 21534e1..ca2e935 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -149,12 +149,12 @@ const DRUPAL_BOOTSTRAP_FULL = 7; /** * Role ID for anonymous users; should match what's in the "role" table. */ -const DRUPAL_ANONYMOUS_RID = 'anonymous user'; +const DRUPAL_ANONYMOUS_RID = 'anonymous'; /** * Role ID for authenticated users; should match what's in the "role" table. */ -const DRUPAL_AUTHENTICATED_RID = 'authenticated user'; +const DRUPAL_AUTHENTICATED_RID = 'authenticated'; /** * The number of bytes in a kilobyte. diff --git a/core/modules/system/tests/upgrade/upgrade.roles.test b/core/modules/system/tests/upgrade/upgrade.roles.test index c1fcef5..f5a166f 100644 --- a/core/modules/system/tests/upgrade/upgrade.roles.test +++ b/core/modules/system/tests/upgrade/upgrade.roles.test @@ -39,6 +39,16 @@ class RoleUpgradePathTestCase extends UpgradePathTestCase { $this->drupalGet('admin/people/permissions/roles/edit/4'); $this->assertResponse(200, 'Role edit page for "gärtner" was found.'); + // Check that the anonymous user role ID has been converted from "1" to + // "anonymous". + $this->drupalGet('admin/people/permissions/' . DRUPAL_ANONYMOUS_RID); + $this->assertResponse(200, 'Permission edit page for "anonymous" was found.'); + + // Check that the authenticated user role ID has been converted from "2" to + // "authenticated". + $this->drupalGet('admin/people/permissions/' . DRUPAL_AUTHENTICATED_RID); + $this->assertResponse(200, 'Permission edit page for "authenticated" was found.'); + // Check that the permission for "gärtner" still exists. $this->drupalGet('admin/people/permissions/4'); $this->assertFieldChecked('edit-4-edit-own-comments', 'Edit own comments permission for "gärtner" is set correctly.'); @@ -47,10 +57,9 @@ class RoleUpgradePathTestCase extends UpgradePathTestCase { // exists. $this->drupalGet('admin/structure/block/manage/user/online/configure'); $this->assertFieldChecked('edit-roles-5', "Who's online block visibility setting is correctly set for the long role name."); - // Check that the role name to label conversion was successful and that the - // labels are displayed. - $this->assertText('gärtner', 'Role label is displayed on block visibility settings.'); - $this->assertText('very long role name that has exactly sixty-four characters in it', 'Role label is displayed on block visibility settings.'); - $this->assertText('very_long role name that has exactly sixty-four characters in it', 'Role label is displayed on block visibility settings.'); + // Check that the role name is still displayed as expected. + $this->assertText('gärtner', 'Role name is displayed on block visibility settings.'); + $this->assertText('very long role name that has exactly sixty-four characters in it', 'Role name is displayed on block visibility settings.'); + $this->assertText('very_long role name that has exactly sixty-four characters in it', 'Role name is displayed on block visibility settings.'); } } diff --git a/core/modules/user/user.permissions.js b/core/modules/user/user.permissions.js index 1a27c2b..2707512 100644 --- a/core/modules/user/user.permissions.js +++ b/core/modules/user/user.permissions.js @@ -32,12 +32,12 @@ Drupal.behaviors.permissions = { .attr('title', Drupal.t("This permission is inherited from the authenticated user role.")) .hide(); - $table.find('input[type=checkbox]').not('.rid-anonymous_user, .rid-authenticated_user').addClass('real-checkbox').each(function () { + $table.find('input[type=checkbox]').not('.rid-anonymous, .rid-authenticated').addClass('real-checkbox').each(function () { $dummy.clone().insertAfter(this); }); // Initialize the authenticated user checkbox. - $table.find('input[type=checkbox].rid-authenticated_user') + $table.find('input[type=checkbox].rid-authenticated') .bind('click.permissions', self.toggle) // .triggerHandler() cannot be used here, as it only affects the first // element.