- Issue created by @alexpott
- Status changed to Active
almost 2 years ago 9:34am 15 March 2023 - Status changed to Needs review
almost 2 years ago 12:17pm 15 March 2023 - 🇮🇳India Ranjit1032002
Uploaded a patch for the issue mentioned, please review.
Thank You. - Status changed to Needs work
almost 2 years ago 12:43pm 15 March 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
-
+++ b/core/modules/user/user.module @@ -255,9 +255,10 @@ function user_role_permissions(array $roles) { function _user_role_permissions_update($roles) { + $entities = Role::loadMultiple($roles); $role_permissions = []; foreach ($roles as $rid) { - $role_permissions[$rid] = \Drupal::config("user.role.$rid")->get('permissions') ?: []; + $role_permissions[$rid] = $entities[$rid]->getPermissions() ?: []; } return $role_permissions; }
This function shouldn't be changing at all. It will be reomved in Drupal 11.
-
+++ b/core/tests/Drupal/Tests/Core/Session/PermissionsHashGeneratorTest.php @@ -252,9 +253,10 @@ public function testGenerateNoCache() { if (!function_exists('user_role_permissions')) { function user_role_permissions(array $roles) { + $entities = Role::loadMultiple($roles); $role_permissions = []; foreach ($roles as $rid) { - $role_permissions[$rid] = []; + $role_permissions[$rid] = $entities[$rid]->getPermissions() ?: []; } return $role_permissions; }
This code should be removed because we change the PermissionsHashGenerator
-
- Status changed to Needs review
almost 2 years ago 1:04pm 15 March 2023 - Status changed to Needs work
almost 2 years ago 3:35pm 15 March 2023 - 🇺🇸United States smustgrave
Moving back to NW for the failures in https://dispatcher.drupalci.org/job/drupal_patches/172699/console
- Status changed to Needs review
almost 2 years ago 6:19pm 15 March 2023 - Status changed to Needs work
almost 2 years ago 11:02pm 15 March 2023 - 🇺🇸United States smustgrave
Thanks @andypost!
Change looks good to me. Only moving to NW for the deprecation tests of the functions that were deprecated. per #5
- Status changed to Needs review
almost 2 years ago 9:28pm 22 March 2023 - Status changed to RTBC
almost 2 years ago 2:33pm 23 March 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
We need to complete the issue summary and change record.
- Status changed to Needs review
almost 2 years ago 3:03pm 24 March 2023 - Status changed to Needs work
almost 2 years ago 11:34pm 25 March 2023 - 🇺🇸United States smustgrave
Wonder if we could provide examples in the CR for _user_role_permissions_update also please.
- Status changed to Needs review
almost 2 years ago 10:48am 26 March 2023 - 🇫🇷France andypost
Added to CR that
_user_role_permissions_update()
has no replacements (it was not API as function name starts with underscore) and config should not be read directly - Status changed to RTBC
almost 2 years ago 12:23am 28 March 2023 - Status changed to Fixed
almost 2 years ago 11:14am 28 March 2023 - 🇬🇧United Kingdom catch
Committed/pushed to 10.1.x, thanks! Nice to see constructor property promotion here.
Automatically closed - issue fixed for 2 weeks with no activity.