diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 1648e84..2a7755d 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -991,7 +991,7 @@ function template_preprocess_block(&$variables) { */ function block_user_role_delete($role) { db_delete('block_role') - ->condition('role', $role->name) + ->condition('role_name', $role->name) ->execute(); } diff --git a/core/modules/field/modules/text/text.test b/core/modules/field/modules/text/text.test index 3514958..125d4ac 100644 --- a/core/modules/field/modules/text/text.test +++ b/core/modules/field/modules/text/text.test @@ -214,7 +214,7 @@ class TextFieldTestCase extends DrupalWebTestCase { $permission = filter_permission_name($format); $roles = $this->web_user->roles; unset($roles[DRUPAL_AUTHENTICATED_ROLE]); - $role = reset(array_keys($roles)); + $role = key($roles); user_role_grant_permissions($role, array($permission)); $this->drupalLogin($this->web_user); diff --git a/core/modules/filter/filter.test b/core/modules/filter/filter.test index 1d8163a..27de4de 100644 --- a/core/modules/filter/filter.test +++ b/core/modules/filter/filter.test @@ -499,7 +499,7 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase { // Get the role name assigned to the regular user. $roles = $this->web_user->roles; unset($roles[DRUPAL_AUTHENTICATED_ROLE]); - $role_name = reset(array_keys($roles)); + $role_name = key($roles); // Check that this role appears in the list of roles that have access to an // allowed text format, but does not appear in the list of roles that have diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc index b9983b1..399b161 100644 --- a/core/modules/user/user.admin.inc +++ b/core/modules/user/user.admin.inc @@ -655,7 +655,7 @@ function user_admin_permissions($form, $form_state, $role_name = NULL) { $role_names = array($role_name => $role_names[$role_name]); } // Fetch permissions for all roles or the one selected role. - $role_permissions = user_role_permissions(array_keys($role_names)); + $role_permissions = user_role_permissions($role_names); // Store $role_names for use when saving the data. $form['role_names'] = array( diff --git a/core/modules/user/user.test b/core/modules/user/user.test index a421c47..2860f43 100644 --- a/core/modules/user/user.test +++ b/core/modules/user/user.test @@ -1111,7 +1111,7 @@ class UserPermissionsTestCase extends DrupalWebTestCase { // Find the new role name. $all_role_names = $this->admin_user->roles; unset($all_role_names[DRUPAL_AUTHENTICATED_ROLE]); - $this->role_name = reset(array_keys($all_role_names)); + $this->role_name = key($all_role_names); } /** @@ -1231,7 +1231,9 @@ class UserAdminTestCase extends DrupalWebTestCase { $this->assertText($user_c->name, t('Found user C on filtered by perm admin users page')); // Filter the users by role. Grab the system-generated role name for User C. - $edit['role'] = max(array_flip($user_c->roles)); + $roles = $user_c->roles; + unset($roles[DRUPAL_AUTHENTICATED_ROLE]); + $edit['role'] = key($roles); $this->drupalPost('admin/people', $edit, t('Refine')); // Check if the correct users show up when filtered by role.