[wp-trac] [WordPress Trac] #39055: REST API: order is ignored when orderby is set to include

WordPress Trac noreply at wordpress.org
Mon Mar 6 02:28:08 UTC 2017


#39055: REST API: order is ignored when orderby is set to include
--------------------------------------+----------------------
 Reporter:  joshlevinson              |       Owner:  jnylen0
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:
Component:  Query                     |     Version:
 Severity:  normal                    |  Resolution:  wontfix
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+----------------------

Comment (by fibonaccina):

 @jnylen0 Sorry for the delay - I agree we should have tests for
 {{{post_name__in}}} and {{{post_parent__in}}} for coverage as well as for
 contributors' reference, since the translation magic happening in
 {{{WP_REST_Posts_Controller}}} may confuse things a bit. So I went ahead
 and attached the remaining tests.

 I noticed that a test for the {{{post_name__in}}} query with no order
 specified already exists in {{{tests/post/query.php}}} via ticket # 36515.
 So I added two more tests, for the {{{post_name__in}}} query with order
 'asc' and 'desc'. The behavior is the same as with {{{post_in}}} - no
 difference in returned order between the two. I added the tests in
 {{{tests/post/results.php}}} but could also relocate them to be grouped
 with the already existing one in {{{tests/post/query.php}}}, let me know
 what you think.

 As for the {{{post_parent__in}}} query, there is a test in
 {{{tests/query/results.php}}} which specifies order 'asc'. I added the
 remaining test with order 'desc' in the latest diff.

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


More information about the wp-trac mailing list