CMS MADE SIMPLE FORGE

Guestbook

 

[#9409] values in $paginate array are not correct on the last page

avatar
Created By: Deleted User (deleteduser_11200)
Date Submitted: Thu Jul 18 08:17:45 -0400 2013

Assigned To:
Version: 1.4_RC2
CMSMS Version: 1.11.7
Severity: Minor
Resolution: None
State: Open
Summary:
values in $paginate array are not correct on the last page
Detailed Description:
While building custom styled pagination buttons in the Guestbook module entylist
view I found that the valujes from the $paginate array are not correct on the
last item.

* How to reproduce:

Setup the Guestbook module with a lot of entries (184) in my situation.  Show 20
entries per page (184/20) so we have 20 different pages to show.

* Call the guestbook module:

{cms_module module='Guestbook' guestbook='1' number='20' mode='entrylist'}

* Print some debuggin info into the entrylist template:

<pre>
{$paginate|@print_r}
size: {$paginate.size}
</pre>

* Watch the debug output on prelast and last page:

the size value is changing from 19 to 3 on the last page, this is incorrect!

== prelast page:

Array
(
    [page_current] => 10
    [page_total] => 10
    [total] => 184
    [first] => 181
    [last] => 184
    [size] => 3
    [url] => http://xxx.lan/guestbook/
    [urlvar] => page_m61366_211
    [current_item] => 181
    [limit] => 20
)
1
size: 3

== last page:

Array
(
    [page_current] => 9
    [page_total] => 10
    [total] => 184
    [first] => 161
    [last] => 180
    [size] => 19
    [url] => http://xxx.lan/guestbook/
    [urlvar] => page_m61366_211
    [current_item] => 161
    [limit] => 20
)
1
size: 19


History