Make WordPress Core

Opened 13 years ago

Closed 9 years ago

#19765 closed defect (bug) (duplicate)

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

Reported by: wpdavis's profile wpdavis Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch needs-refresh
Focuses: administration, multisite Cc:

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 (3)

class-wp-users-list-table.patch (1.7 KB) - added by wpdavis 13 years ago.
class-wp-users-list-table.diff (1.6 KB) - added by wpdavis 13 years ago.
Removing extra switch_to_blog
19765.patch (2.8 KB) - added by wpdavis 11 years ago.

Download all attachments as: .zip

Change History (10)

#1 @nacin
13 years ago

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?

#2 @DrewAPicture
13 years ago

  • Cc xoodrew@… added

#3 @wpdavis
13 years ago

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.

@wpdavis
13 years ago

Removing extra switch_to_blog

#4 @wpdavis
11 years ago

Problem is still relevant. You need to switch_to_blog() in order to get the roles at all — even the slugs — but you can combine everything switch_to_blog() is needed for in one place. Patch attached.

@wpdavis
11 years ago

#5 @jeremyfelt
10 years ago

  • Component changed from Network Admin to Users
  • Focuses administration added

#6 @chriscct7
9 years ago

  • Keywords needs-refresh added

#7 @jeremyfelt
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This seems to be a duplicate of #17394.

Note: See TracTickets for help on using tickets.