[wp-trac] [WordPress Trac] #35137: get_terms() with a meta_query filter returns duplicated terms

WordPress Trac noreply at wordpress.org
Fri Dec 18 17:43:48 UTC 2015


#35137: get_terms() with a meta_query filter returns duplicated terms
--------------------------------------+---------------------------
 Reporter:  jadpm                     |       Owner:  boonebgorges
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  4.4.1
Component:  Taxonomy                  |     Version:  4.4
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------------
Changes (by boonebgorges):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"36003"]:
 {{{
 #!CommitTicketReference repository="" revision="36003"
 Ensure `get_terms()` results are unique when using 'meta_query'.

 The introduction of 'meta_query' to `get_terms()` in 4.4 made it possible
 for
 `get_terms()` to erroneously return duplicate results. To address the
 issue,
 we add the `DISTINCT` keyword to the SQL query when a 'meta_query'
 parameter
 has been provided.

 Props @jadpm.
 Fixes #35137.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35137#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list