Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla Pagination Bug
dan39
New
Hey, is this a bug?
"The Official I Hate PCs Discussion" just surpassed 8 pages. But, when you are on Page 1, the pagination doesn't show you that the last page is actually Page #9. However, on the Discussions index, the pagination shows you what the final page of Discussions is. For instance, it currently says "8...143 >"
I think I've noticed similar behavior when the Discussions index surpases 8 pages for the first time.
Is there a point where it begins to show you what the context of the last page is?
"The Official I Hate PCs Discussion" just surpassed 8 pages. But, when you are on Page 1, the pagination doesn't show you that the last page is actually Page #9. However, on the Discussions index, the pagination shows you what the final page of Discussions is. For instance, it currently says "8...143 >"
I think I've noticed similar behavior when the Discussions index surpases 8 pages for the first time.
Is there a point where it begins to show you what the context of the last page is?
0
This discussion has been closed.
Comments
The DiscussionPages extension probably has the same code as here.
$PageCount = CalculateNumberOfPages($Discussion->CountComments, $CommentsPerPage);
It's probably doing some integer rounding.
Yep, I found it in the framework functions. It is rounding the count.
What I think it is, is
if ($CurrentPage < ($PageCount - $MidPoint) && $PageCount > $this->PagesToDisplay + 1) {
on line 215 in Framework.Class.PageList. I think it should beif ($CurrentPage < ($PageCount - $MidPoint) && $PageCount > $this->PagesToDisplay - 1) {
(minus instead of plus at the end there).