[wp-trac] [WordPress Trac] #42014: Return correct role counts in `count_users()` when passing a different site ID
WordPress Trac
noreply at wordpress.org
Sat Sep 30 03:53:29 UTC 2017
#42014: Return correct role counts in `count_users()` when passing a different site
ID
--------------------------------------+------------------------
Reporter: flixos90 | Owner: flixos90
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.9
Component: Role/Capability | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: multisite
--------------------------------------+------------------------
Changes (by flixos90):
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"41653"]:
{{{
#!CommitTicketReference repository="" revision="41653"
Multisite: Fix `count_users()` possibly querying incorrect roles when
passed a different site ID.
The `time` strategy in `count_users()` queries users by role. However, the
roles queried for were not affected by passing another site than the
current one through the `$site_id` parameter, causing users having roles
that were not queried for to appear as users without a role. This
changeset fixes the issue by switching the site before retrieving the
roles to query for.
Fixes #42014.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42014#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list