XF 2.2 Pagination issues - one too many pages in thread if posts divisible by the number per page?

Fullmental

Active member
We are seeing a weird issue where, if the number of post replies is divisible by 20 exactly (we have XF set to 20 posts per page), a thread will display a new page for a presumed latest post that should be there, but is instead displayed on the previous page. As such, when someone clicks the page number for the last page, or hits the "go to last page" button, they'll get redirected to the first page instead. Example, this thread has 420 replies, which would mean 421 total posts and the need for a 21st page, but the 421st post is on page 20 instead, and page 21 is empty and redirects the user to the first page

1688011718633.png

How is this typically handled? Is there a cache we could rebuild that might help with this problem, or something else we can check?
 
Last edited:
Figured it out. There's a buggy addon somewhere messing with the pagination. Disabling all addons and running the thread rebuild job with "Rebuild position and post counters" enabled restores the pagination to the correct behavior. Will have to run through and find the addon, then report the bug to the devs.

Does this rebuild job with the rebuild position and post counters option ever get triggered by a hourly/daily/other cron job? Just want to know if I need to disable the addon, as otherwise it's functioning normally. If it doesn't get triggered automatically, I can leave it enabled while waiting on a fix from the developer.
 
Last edited:
Top Bottom