Change WordPress user roles and capabilities Forums Bug Reports primary role not retrieved when changing capabilities

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5438

    Hi Vladimir,

    I’ve got an issue for users who are non-admin and had the capabilities to chang/add secondary roles to users. I created another role “user admin” which had basically all the User and the URE capabilities.

    With this role, non-admin users could go to a user and then add some role to them.

    image

    My issue now is that the “primary role” is not retrieved when non-admin users are accessing the capabilities and then the update removes their primary role, replacing it with the first secondary roles which was granted. Results is that this user do not have the default “subsriber” role and lose some other capabilities.

    When changing the “user admin” role and giving it all capabilities -> Bug still there
    When giving the user “admin” role -> can retrieve the primary role and update as before.

    Whant should I do ?

    #5439

    I was also trying to update the website as per my other requests
    according to this topic.

    It seems that the code snippet in the post above is solving the current bug : it removes the dropdown to choose the main role, which is fine and also solve this issue. My assumption is that there is no need to display the primary role, hence there are no error to display it, hence there is no change in the dropdown, and the primary role is kept as-is which was my original goals.

    I still don’t know why the primary role was not displayed correctly as first, if you want to investigate, feel free to liaise with me

    #5441
    Vladimir
    Keymaster

    Hi,

    Good that you found a workaround.
    I can not repeat the described issue though. Can you record a short video with the steps which I should do to repeat it?

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.