Opened 5 years ago
Last modified 5 years ago
#48459 new defect (bug)
Unable to list users with 'No role for this site'
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 5.2.4 |
Component: | Users | Keywords: | |
Focuses: | administration | Cc: |
Description
I noticed that I had one user registered on my site with 'No role' in the summary. However, clicking on 'No Role' lists all ? users, rather than the one I wanted [so I could remove it]. The only way to find it was to page through all the users (in my case the 3rd) until I found one with a role of 'None'.
To reproduce: Create a user; Edit the user and set role to 'No role for this site'; List all users; Click on 'No role' in the summary. This should display just the one user?
[Is it significant the summary shows as 'No role' but the listing shows 'None']
Attachments (1)
Change History (5)
#3
@
5 years ago
This is single site ... its perhaps more subtle than I first thought ...
I have a custom role (created with Advanced Access Manage) which (I assume - its a while ago) was inherited from No Role. Its these users which are appearing together with No Role in the No Role list.
Although I did today create a new role, again inherited from No Role, which does not appear in this list ...
Please see attached image
#4
@
5 years ago
I've been doing a bit of digging. In wp_get_users_with_no_role, the call to wp_roles()->get_names() is including "ddatower" in the list. However the actual capability in the user metadata is "dda tower", as a result the not regexp 'administrator|editor|author|contributor|subscriber|bellrepairfund|ddatower' is failing to exclude "dda tower".
I should also point out that this list does not include "ddaauthor" or "dda author".
[Why not just look for an empty capability here?]
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Adding some links to previous related tickets, for reference: #22993, #36196, #38851.