[ 
http://jira.magnolia-cms.com/browse/MGNLSTK-744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zdenek Skodik updated MGNLSTK-744:
----------------------------------

         Assignee: Ondřej Chytil  (was: Philipp Bärfuss)
    Fix Version/s: 1.4.3

> Paging broken due to wrong offset calculation
> ---------------------------------------------
>
>                 Key: MGNLSTK-744
>                 URL: http://jira.magnolia-cms.com/browse/MGNLSTK-744
>             Project: Magnolia Standard Templating Kit
>          Issue Type: Bug
>    Affects Versions: 1.4.2
>         Environment: all systems
>            Reporter: Frank Rittinger
>            Assignee: Ondřej Chytil
>            Priority: Major
>             Fix For: 1.4.3
>
>
> STKPager calculates wrong sublist for display due to an error in the offset 
> calculation. This was introduced by the update from 1.4.1 to 1.4.2:
> {noformat}
>     protected int getOffset() {
>         int offset = ((getCurrentPage()) * maxResultsPerPage) -1;
>         if(offset > count) {
>             int pages = count / maxResultsPerPage;
>             offset = pages * maxResultsPerPage;
>         }
>         return offset;
>     }
> {noformat}
> should be
> {noformat}
>     protected int getOffset() {
>         int offset = (getCurrentPage() - 1) * maxResultsPerPage;
>         if(offset > count) {
>             int pages = count / maxResultsPerPage;
>             offset = pages * maxResultsPerPage;
>         }
>         return offset;
>     }
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to