[wp-trac] [WordPress Trac] #32592: Duplicate user results when using nested meta queries with inner OR relation
WordPress Trac
noreply at wordpress.org
Tue Jun 9 17:41:38 UTC 2015
#32592: Duplicate user results when using nested meta queries with inner OR
relation
--------------------------+---------------------------
Reporter: maxxsnake | Owner: boonebgorges
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.3
Component: Users | Version: 4.2.2
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):
* owner: => boonebgorges
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"32713"]:
{{{
#!CommitTicketReference repository="" revision="32713"
Avoid returning duplicate matches when using a meta query in
`WP_User_Query`.
A meta_query containing an `OR` relation can result in the same record
matching
multiple clauses, leading to duplicate results. The previous prevention
against
duplicates [18178] #17582 became unreliable in 4.1 when `WP_Meta_Query`
introduced support for nested clauses. The current changeset adds a new
method
`WP_Meta_Query::has_or_relation()` for checking whether an `OR` relation
appears anywhere in the query, and uses the new method in `WP_User_Query`
to
enforce distinct results as necessary.
Props maxxsnake.
Fixes #32592.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32592#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list