Change WordPress user roles and capabilities Forums Bug Reports message: Can not edit user or invalid data at the users list

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3952
    [email protected]
    Participant

    I go to the user list, click the checkbox by a user, click “Grant Roles,” then the “Grant Roles to Selected Users” window comes up. Then either I change some roles, or do nothing at all and click “OK.”

    Then the “working” message shows up and after that a message appears: “Can not edit user or invalid data at the users list”

    What does that message mean? How do I fix it?

    It does look like it edits the roles, even though the error message appears every time.

    #3954
    [email protected]
    Participant

    Correction: It didn’t save. When I clicked the “Grant Roles” button again the checkmark was there for that role, but when I refreshed the entire page, it was gone.

    #3955
    [email protected]
    Participant

    Also, the readme file says:
    Stable tag: 4.35.1

    #3960
    Vladimir
    Keymaster

    User Role Editor does nothing if you see this error message. URE shows this message in 2 cases:
    1) invalid user ID in the list of users ID to process;
    2) current user can not edit one of the selected users. Look, may be you accidentally select some user with superadmin privileges.

    Look how WordPress checks if user can edit other user under multisite:

    
    // In multisite the user must have manage_network_users caps. If editing a super admin, the user must be a super admin.
    if ( is_multisite() && ( ( ! is_super_admin( $user_id ) && 'edit_user' === $cap && is_super_admin( $args[0] ) ) || ! user_can( $user_id, 'manage_network_users' ) ) ) {
    		$caps[] = 'do_not_allow';
    	} else {
    		$caps[] = 'edit_users'; // edit_user maps to edit_users.
    	}
    

    User should be a superadmin to edit other superadmin, or have ‘manage_network_users’ capability.

    #3962
    [email protected]
    Participant

    Ah ok, I was trying to edit a superadmin, just for testing purposes.

    Thanks.

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