[wp-trac] [WordPress Trac] #38034: post__in orderby not working when passed in an array to orderby

WordPress Trac noreply at wordpress.org
Fri Jan 4 21:52:30 UTC 2019


#38034: post__in orderby not working when passed in an array to orderby
--------------------------+-----------------------------
 Reporter:  kelvink       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Query         |     Version:  4.6
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------

Comment (by boonebgorges):

 Additionally, I'm seeing some test failures:

 {{{
 1) Tests_Query_Results::test_query_orderby_post_parent__in_with_order_desc
 Failed asserting that two arrays are equal.
 --- Expected
 +++ Actual
 @@ @@
  Array (
 -    0 => 'child-three'
 -    1 => 'child-four'
 -    2 => 'child-one'
 -    3 => 'child-two'
 +    0 => 'child-one'
 +    1 => 'child-two'
 +    2 => 'child-three'
 +    3 => 'child-four'

 /home/bgorges/sites/wpdev/tests/phpunit/tests/query/results.php:619

 2) Tests_Query_Results::test_query_orderby_post__in_with_order_desc
 Failed asserting that Array &0 (
     0 => 1626
     1 => 1628
     2 => 1627
 ) is identical to Array &0 (
     0 => 1627
     1 => 1628
     2 => 1626
 ).

 /home/bgorges/sites/wpdev/tests/phpunit/tests/query/results.php:679

 3) Tests_Query_Results::test_query_orderby_post_name__in_with_order_desc
 Failed asserting that Array &0 (
     0 => 'parent-three'
     1 => 'parent-one'
     2 => 'parent-two'
 ) is identical to Array &0 (
     0 => 'parent-two'
     1 => 'parent-one'
     2 => 'parent-three'
 ).

 /home/bgorges/sites/wpdev/tests/phpunit/tests/query/results.php:714
 }}}

 I haven't looked into these in detail, but they appear to be related.
 Could you please run `grunt copy:files && phpunit --group=post,query` to
 have a look?

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


More information about the wp-trac mailing list