Hi there,
Following are the steps to regenerate the issue:
I put a IP range per role under the tab 'Restrict role by IP'. I logged in as an administrator and tried to edit user profiles. The roles that have IP restriction are not checked on the roles checkbox list even though those roles are assigned to the particular users. Could you please have a look into this issue? Thanks for your help in advance!

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

DrupalBDGirl created an issue. See original summary.

amairesse’s picture

Hi,
Same issue here.
As a note, I have noticed that
- If the admin user opening the edit form is logged in on an IP address allowed for the given role, (s)he will see this role checked if it is set
- This behavior seems not to affect all roles (I didn't identify a pattern yet)

rocketeerbkw’s picture

Version: 8.x-4.0-beta1 » 8.x-4.x-dev
Status: Needs work » Active

The "Needs Work" status is used when a patch/merge request still needs changes, but there isn't one yet.

anybody’s picture

Priority: Normal » Major
Issue tags: +Needs tests

This is a major issue in my eyes. The fix should have tests and we should check if saving such a user profile then also removes its roles!

darvanen made their first commit to this issue’s fork.

darvanen’s picture

Version: 8.x-4.x-dev » 9.x-dev
Assigned: Unassigned » darvanen

darvanen’s picture

Assigned: darvanen » Unassigned
Status: Active » Needs review

Removed the module hook which stripped the roles from the user edit form, definite bug. There's a bit more test coverage in there now. Could use another set of eyes.

I was assisted by AI for this work.

darvanen’s picture

It's worth pointing out that admins will now be able to allocate roles that they were technically blocked from allocating before. I see that as a responsibility of https://www.drupal.org/project/role_delegation to handle, not this module.

  • darvanen committed 0be0a337 on 9.x
    fix: #3274832 User role is not selected on the edit page after...
darvanen’s picture

Status: Needs review » Fixed

That's long enough to wait for something in an unreleased branch :)

Thanks everyoe for your help!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.