[wp-trac] [WordPress Trac] #53201: Admin UI Posts: Pagination via offset uses inconsistent sorting for tie-breaks

WordPress Trac noreply at wordpress.org
Thu May 13 15:30:42 UTC 2021


#53201: Admin UI Posts: Pagination via offset uses inconsistent sorting for tie-
breaks
--------------------------+-----------------------------
 Reporter:  msea55        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 On the admin ui where posts are displayed by post type, when the user
 paginates from the first page to the second ties in the sort criteria are
 not handled consistently. On the site I am working on, I have a post type
 with 31 posts. Each of the 31 posts has the same exact post date, (all
 created by a bulk action). In the admin ui, when the user paginates from
 the first page, to the second (post date is the default sort on this
 page), some posts appear on both the first and second pages, while others
 appear on neither.

 The WP_Posts_List_Table uses WP_Query::get_posts() which sorts based on
 either a passed in sort criteria or a default if none is passed in.
 WP_Posts_List_Table passes in the sort criteria of either whatever column
 is selected by the user, or nothing if none are selected. A site which
 doesn't override this behavior could encounter the issue I described. I
 would ask that either the edit posts query include a fallback secondary
 sort of ID (though this would have to not override the default if no sort
 is selected), or that the admin ui post viewer not use get_posts and
 instead use something that remembers the results returned on the first
 page when moving to the second.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53201>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list