Page 1 of 1

News pagination bug - and codefix

Posted: Wed Aug 01, 2007 3:09 pm
by bigtony
Hi. I spotted a pagination error on the News module (v. 2.3) on CMSMS v. 1.1

For example, if you set the option pagelimit="2" and have exactly 2 news items in the database, there should obviously only be 1 page, but it gives the pagination saying there are 2 pages. Clicking to see page 2 gives an empty page.

I have changed the code in action.default.php (around lines 158-159)

FROM:

Code: Select all

$pagecount = intval($row2['count'] / $pagelimit);
if( ($pagecount % $pagelimit) != 0 ) $pagecount++;
TO:

Code: Select all

$pagecount = (intval($row2['count'] / $pagelimit)) + 1;
if( ($row2['count'] % $pagelimit) == 0 ) $pagecount--;
And this seems to fix the paging problem. Hope this helps someone.

Re: News pagination bug - and codefix

Posted: Wed Aug 01, 2007 5:13 pm
by calguy1000
I've already fixed it in svn.... it should be available when CMS 1.1.1 comes out.