solved Something off with pagination

SteveX
SteveX
@ultrajam
6 years ago
2,584 posts
Here on jamroom.net, when a user has made 50 posts to the forum the "next" button can show on page 5

Currently, click the next page button here:
https://www.jamroom.net/forum/activity/116/mountaintop/p=5
You will see the info notice:
Quote: This user has not posted any topics to the forum
But the user has posted 50 posts on the forum!

Should there be a different language string in the notice, or should the "next" button be disabled or not show at all?



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 08/28/18 02:45:23AM
michael
@michael
6 years ago
7,750 posts
looks like the issue is the next page button should not be showing.

My guess is its something like "show pagination for next page if x = 50" but should be x < 50.

Thanks.
brian
@brian
6 years ago
10,148 posts
This is actually expected behavior when using "simplepagebreak".

Mountaintop has posted exactly 50 topics. With simplepagebreak being used (instead of the normal pagebreak due to the size of the datastore and the "Use Optimized Pager" setting enabled in the Core), there is no "total" SQL query that is run to determine the total number of posts. The counting SQL query used with the regular pagebreak is the slowest part of the function, so we exclude that when using simplepagebreak and just assume that if we can fill an entire page to it's simplepagebreak number, then we always show the "next page" link. In this case if Mountaintop had 49 or 51 posts this would not be an issue, but since he is right at 50 we show the "next page" link even though there is no next page.

This is an acceptable side effect for % of time you run into it versus the every-request drastic performance improvement you get from not running the counting query.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 05/28/18 08:37:19AM
brian
@brian
6 years ago
10,148 posts
I believe we have a fix for this in Core 6.1.8 thanks to Michael :)


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags