- Issue created by @tr
 - Assigned to sarwan_verma
 - Issue was unassigned.
 - Status changed to Needs review
over 1 year ago 5:24am 26 June 2024 - 🇮🇳India sarwan_verma
Hi @TR,
I've created the patch for this , please verify the attached patch.
 - Status changed to Needs work
over 1 year ago 5:35am 26 June 2024 - 🇺🇸United States tr Cascadia
// Use parameter FALSE to include 'Anonymous'. - $roles = user_role_names(FALSE); + $roles = Role::loadMultiple(FALSE);This doesn't work.
loadMultiple() doesn't take a boolean argument.
You have to make sure that the value of $roles doesn't change. I suggest reading the change record that I linked. - last update
over 1 year ago 292 pass, 92 fail - Status changed to Needs review
over 1 year ago 7:00am 26 June 2024 - 🇮🇳India sarwan_verma
I have added the new updated patch ,kindly review and verify. Thanks.
 - Status changed to Needs work
over 1 year ago 8:06am 26 June 2024 - First commit to issue fork.
 - Merge request !38Issue #3457135 "Deprecation fix user roles method" → (Merged) created by ankitv18
 - 🇮🇳India ankitv18
ankitv18 → changed the visibility of the branch 3457135-10.2-userroles-and to hidden.
 - Status changed to Needs review
over 1 year ago 5:45pm 26 June 2024 - Status changed to Needs work
over 1 year ago 6:22pm 26 June 2024 - 🇺🇸United States tr Cascadia
Again,
user_role_names()andRole::loadMultiple()DO NOT GENERATE THE SAME OUTPUT. You can't simply substitute one for the other. More work needs to be done.The contents of
$rolesneeds to be EXACTLY THE SAME after the change as it was before the change.Here is a little drush script that demonstrates this is wrong. This prints the value of
$roleswith the old code then prints the value of$roleswith the new code. Run this asdrush php-script 3457135-roles.txt - Assigned to bharath-kondeti
 - Issue was unassigned.
 - Status changed to Needs review
over 1 year ago 5:30am 27 June 2024 - 🇺🇸United States tr Cascadia
I don't think
Html::escape()is correct here, so I removed it. The original functionuser_role_names()does not use it. Also, this was discussed in the core issue linked in the change notice. Although the core patch did use it in some places, there was a follow-up issue to remove it.Regardless, in Rules, this code appears in an
OptionsProvider, and sanitation should not take place this early - that should be left to the rendering stage. We have no knowledge in theOptionsProviderabout how the data will eventually be used, so IMO it is premature to modify it withescape(). - 🇮🇳India bharath-kondeti Hyderabad
Okay. Thanks for the review. @TR do we have to address the build issues on PR in this issue itself ?
 - 
            
              TR →
             committed 13d625d2 on 4.0.x authored by 
            
              ankitv18 →
            
Issue #3457135 by TR, bharath-kondeti: [10.2] user_roles() and...
 
- 
            
              TR →
             committed 13d625d2 on 4.0.x authored by 
            
              ankitv18 →
            
 - Status changed to Fixed
over 1 year ago 4:38am 29 June 2024 - 🇺🇸United States tr Cascadia
Only need to address things caused by this MR, but there are none. I still trying to get all the tests back and running - they're failing due to changed in D10.3 and due to the change from DrupalCI to GitLabCI. I'm working on it, and it's almost all fixed now.
 Automatically closed - issue fixed for 2 weeks with no activity.