Make WordPress Core

Opened 10 years ago

Closed 5 years ago

#18762 closed defect (bug) (invalid)

Pagination does not work correctly on walker in reverse order.

Reported by: gburtini Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2
Component: Comments Keywords: needs-testing
Focuses: Cc:


Steps to reproduce:

  1. Go to Discussion and change Comments should be displayed with the comments at the top of each page to "newer" (that is, set comment_order='desc').
  2. Make sure your theme is paginating comments. Make sure you have more than the page limit of comments.
  3. Note that the first page does not actually contain the newest comments (they're off by a page, or perhaps they're just sorted in one way for the pagination and a different way for the inner page sort).

If you check out the $start, $oldstart and $end variables, the way it was written before the patch, $start gets set to 11 (page limit + 1) on page = 1, the way it is written after the patch, start is 0, as it should be.

All I've done is swapped the order of $start and $end being updated. This fixes the starting point. This needs to be tested in more detail before actually deploying it, but there is definitely a pretty serious bug here.

Attachments (1)

fix_reverse_order_pagination.diff (895 bytes) - added by gburtini 10 years ago.
Patch to fix strange sort order.

Download all attachments as: .zip

Change History (8)

10 years ago

Patch to fix strange sort order.

#1 @SergeyBiryukov
10 years ago

  • Keywords has-patch added

#2 @coffee2code
9 years ago

  • Version set to 3.2.1

#3 @chriscct7
6 years ago

  • Keywords needs-refresh added; has-patch removed
  • Version changed from 3.2.1 to 3.2

This ticket was mentioned in Slack in #core-comments by rachelbaker. View the logs.

5 years ago

#5 @boonebgorges
5 years ago

  • Keywords needs-testing added; needs-refresh removed

Has anyone reproduced this issue lately? The logic surrounding comment pagination was rewritten in 4.4, and it's possible that this bug was fixed as a part of that work.

#6 @LittleBigThing
5 years ago


I tried to reproduce it, but I couldn't using:

  • WP 4.5.2 + Twentysixteen
  • WP 4.6-alpha-37403 + Twentysixteen
  • WP 4.6-alpha-37403 + Twentyfifteen

Reversed comment order (newest first) was OK with and without pagination.

#7 @boonebgorges
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Thank you, @LittleBigThing ! Let's close. If anyone is able to reproduce at some point in the future, feel free to reopen with details.

Note: See TracTickets for help on using tickets.