[wp-trac] [WordPress Trac] #21119: Make WP_User_Query::prepare_query() public
WordPress Trac
noreply at wordpress.org
Fri Apr 11 03:56:51 UTC 2014
#21119: Make WP_User_Query::prepare_query() public
----------------------------------------+-----------------------------
Reporter: scribu | Owner: wonderboymusic
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.9
Component: Users | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+-----------------------------
Changes (by nacin):
* status: closed => reopened
* resolution: fixed =>
Comment:
As noted in #27741, these unit tests fail under multisite. Multisite does
indeed have a quirk here as it relates to WP_User_Query::prepare_query(),
and I don't think it's the test that's the problem, but rather, this new
public method.
The final $query->prepare_query() call re-does all of the logic in
prepare_query(), re-adding another meta query for is_multisite(). This
makes this function not safe to be called a second time, and I believe the
intention was that it should.
{{{
[meta_query] => Array(
[0] => Array( [key] => wptests_capabilities )
[1] => Array( [key] => wptests_capabilities )
)
}}}
On the bright side, this doesn't *appear* to break anything. We should
just be able to just look for an existing duplicate meta query and discard
adding a new one. Patch attached, [attachment:21119.4.diff]. As it doesn't
seem to break anything as-is, I could spin this into a new ticket for
post-3.9 if necessary.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21119#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list