News pagination bug - and codefix
Posted: Wed Aug 01, 2007 3:09 pm
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:
TO:
And this seems to fix the paging problem. Hope this helps someone.
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++;
Code: Select all
$pagecount = (intval($row2['count'] / $pagelimit)) + 1;
if( ($row2['count'] % $pagelimit) == 0 ) $pagecount--;