Hi guys this module looks like exactly what my usecase needs. This this is my first-time install of the module.
I have a role of privileged users (MgtCommittee) and I want these folks to be able to set the roles of new users in less-privileged roles, say "registered maintainer" in my example.
I've gone through the docos and have:
- Given the MgtCommittee perms to manage users and assign roles
- Set the lower-class role to be available to AssignRoles
However, when my MgtCommittee user edits an existing user (eg, Joe Testing) or creates a new user, they get a recount of (Assignable Roles), but they do not get a checkbox button form element so they can assign the applicable role (eg, registered maintainer)

I am also using the NodeAccess module, but only for user-level grants on nodes (ie, no role-based permissions).
Is there anything I can do to troubleshoot or figure out what is going on here?
Thanks!

| Comment | File | Size | Author |
|---|---|---|---|
| #13 | after.png | 57.38 KB | lucassc |
| #13 | before.png | 51.92 KB | lucassc |
| #10 | Screenshot from 2022-09-05 17-02-29.png | 21.36 KB | sophiavs |
| #10 | 3135048-10.patch | 873 bytes | sophiavs |
| #4 | no_roles_appear-1319154-4.patch | 2.39 KB | nick dewitte |
Comments
Comment #2
nick dewitte commentedThis issue is caused when saving the array of roles that can be modified.
It is saved in a format that is different from the array returned by
user_role_names(TRUE);.When loading the roles that are present on both of these arrays, none are returned, because they don't have the same format.
I've created a patch that uses the "correct" format (machine_name => Display name) to save the list of roles that can be modified when submitting the form.
Comment #3
nick dewitte commentedIt appears I've missed something.
When loading the form, the current configuration is not shown.
Comment #4
nick dewitte commentedChanges:
- Fixed default values for the form display.
- Fixed faulty data when enabling only some roles.
- Fixed missing punctuation.
Comment #5
boabjohn commentedHey there @nick.dewitte yer a legend mate! I'm just testing within my own little world, but it looks like this patch is a beauty. We're in business.
Cheers!
Comment #6
cola commentedcan confirm patch works
Edit: Sorry have to write again, the path is not working on Drupal 9. The roles are not saved
Comment #7
liam morlandI found that after applying this patch, I needed to visit admin/people/roleassign and re-save the configuration. That made the roles appear, but I still could not save them. It would say "There was a problem with your form submission."
Comment #8
cedeweyMarking this as Needs Work since several people reported issues with the latest patch.
Comment #9
sophiavs commentedHi, i'll try to work on this
Comment #10
sophiavs commentedSince the previous patch was working for some people and not for others i created a new patch from the begging.
It appears to be working. In case of any suggestion just comment that i can improve :)
Comment #11
sophiavs commentedComment #12
lucasscComment #13
lucasscHi!
Patch in #10 works well, +1 for this.
Here's what I did in this review:
- created "MgtCommittee" and "registered maintainer" roles;
- added users "mgtcommittee" and "joe_testing" with the roles above;
- went to /admin/people/roleassign and I selected roles "MgtCommittee" and "registered maintainer";
- added the following permissions:
- then I logged as mgtcommittee and went to /user/3/edit.
Before:
After:
Leaving status as "Needs Review" for those who had problems before check it again.
Comment #14
lucasscI think it can be marked as RTBC If no one else disagrees.
Comment #15
rajab natshahI faced this issue, while testing #3297982: Automated Drupal 10 compatibility fixes
Comment #16
rajab natshahIt feels that this module is not functional.
following with
Assertions in the Automated testing are not doing the right needed checks.
Comment #17
rajab natshahThank you for the patch from #10
Comment #18
nord102Although there has been some documented steps in this thread, I am having trouble reproducing this. Can someone provide some clearer steps on how to reproduce as well as what version of core you're testing on?