[wp-trac] [WordPress Trac] #32659: Orderby meta clause in meta_query not working in 4.2.2

WordPress Trac noreply at wordpress.org
Tue Jun 16 12:26:11 UTC 2015


#32659: Orderby meta clause in meta_query not working in 4.2.2
--------------------------+------------------------------------------
 Reporter:  dariopad      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  4.2.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  administration, performance
--------------------------+------------------------------------------

Comment (by boonebgorges):

 Can you share more details about what you're seeing, and what you expect
 to see?

 My guess is that it's not working because 'my_clause' is not a first-order
 clause. The SQL for that section looks something like this:

 {{{
   ...OR (
     ( mt2.key = 'any_key' AND mt2.value = '1' )
     AND
     ( mt3.key = 'another_key' AND mt3.value = '1' )
   )
 }}}

 As such, when the `ORDER BY` clause for 'my_clause' is built,
 `WP_Meta_Query` is unsure whether to use `mt2` or `mt3`.

 Any more details you could provide would be helpful.

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


More information about the wp-trac mailing list