Making WordPress.org

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#2481 closed defect (bug) (fixed)

Forums: Pagination doesn't account for archived posts

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by:
Milestone: Priority: normal
Component: Support Forums Keywords:
Cc:

Description (last modified by SergeyBiryukov)

Steps to reproduce:

  1. The topic has 16 posts (current setting is 15 posts per page).
  2. There's one archived post in the middle of the topic, so only 15 posts are visible.
  3. "All Topics" view erroneously displays two pages instead of one.
  4. The "Last Post" link leads to the second page, but the post is not there (it's on the first page).

Related: #1984, #2043, #2171.

Change History (10)

#1 @SergeyBiryukov
7 years ago

  • Description modified (diff)

#2 @denisco
7 years ago

Ticket #2043 has a patch to solve this problem.

#3 follow-ups: @SergeyBiryukov
7 years ago

Just stumbled upon this again in this topic, which doesn't have any archived replies at the moment, but has -1 hidden posts. I guess any type of hidden posts could cause this (Spam or Pending too, not just Archived).

Until #2043 is fixed, it would help if moderators had an option to manually fix incorrect post count for affected topics.

#4 @SergeyBiryukov
7 years ago

Another potential workaround (which could be a separate feature) is to perform a canonical redirect from any page past the max number of pages to the latest existing page, see #WP11694 and #WP28081 for WordPress core.

#5 in reply to: ↑ 3 @SergeyBiryukov
7 years ago

Replying to SergeyBiryukov:

I guess any type of hidden posts could cause this (Spam or Pending too, not just Archived).

Confirmed, triggered the incorrect replies counts issue recently a couple of times:

  1. Reply to a topic that had no replies, it has 1 reply now.
  2. Edit your reply to fix a typo or something.
  3. Akismet didn't flag the initial post, but flags the edited one for some reason, without updating the replies count.
  4. Once you unspam the post, the topic has 2 replies (+ -1 hidden).
Last edited 7 years ago by SergeyBiryukov (previous) (diff)

This ticket was mentioned in Slack in #forums by sergey. View the logs.


7 years ago

#7 @SergeyBiryukov
7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [5672] and [5673].

#8 in reply to: ↑ 3 @SergeyBiryukov
7 years ago

Replying to SergeyBiryukov:

Until #2043 is fixed, it would help if moderators had an option to manually fix incorrect post count for affected topics.

Addressed in [5675] for #1971. If you notice a topic with incorrect replies count, re-saving it should update the count.

Last edited 7 years ago by SergeyBiryukov (previous) (diff)

#9 @SergeyBiryukov
7 years ago

In 5693:

Support Forums: Update the necessary meta data when editing a reply created before 2017-07-17, as those replies can have potentially inaccurate data.

See #2110, #2481.

#10 @SergeyBiryukov
7 years ago

In 5695:

Support Forums: In Dropin::update_old_reply_meta(), don't recalculate position for archived replies.

Archived replies are not returned by bbp_get_all_child_ids(), so they end up with a zero position.

See #2110, #2481.

Note: See TracTickets for help on using tickets.