Opened 17 months ago

Last modified 17 months ago

#19765 new defect (bug)

site-users.php in network admin doesn't display users with custom roles

Reported by: wpdavis Owned by:
Priority: normal Milestone: Awaiting Review
Component: Network Admin Version:
Severity: normal Keywords: has-patch
Cc: xoodrew@…

Description

In the network admin when looking at the users of a specific site, if the site has a custom role the users with that role will not show up. The patch attached ensures that switch_to_blog() is used at the correct places so that data is being gathered from the correct site, not from the main site.

Attachments (2)

class-wp-users-list-table.patch (1.7 KB) - added by wpdavis 17 months ago.
class-wp-users-list-table.diff (1.6 KB) - added by wpdavis 17 months ago.
Removing extra switch_to_blog

Download all attachments as: .zip

Change History (5)

I would think that a switch_to_blog() is unnecessary here. We know the user's roles from the meta key, or at least the role's key ("administrator" rather than "Administrator"). We should be able to display the role's key in the case where the role is not registered on the main site.

Perhaps we should have a switch_to_blog() for larger reasons. PeteMall?

  • Cc xoodrew@… added

Which switch_to_blog are you referring to? The one I added in prepare_items is necessary for the query for custom roles to run correctly — without it, when you look for all users with custom_role it returns nothing.

Removing extra switch_to_blog

Note: See TracTickets for help on using tickets.