Uploaded image for project: 'Magnolia Standard Templating Kit (closed)'
  1. Magnolia Standard Templating Kit (closed)
  2. MGNLSTK-744

Paging broken due to wrong offset calculation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.4.3
    • 1.4.2
    • None
    • None
    • all systems
    • Yes

    Description

      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:

          protected int getOffset() {
              int offset = ((getCurrentPage()) * maxResultsPerPage) -1;
              if(offset > count) {
                  int pages = count / maxResultsPerPage;
                  offset = pages * maxResultsPerPage;
              }
              return offset;
          }
      

      should be

          protected int getOffset() {
              int offset = (getCurrentPage() - 1) * maxResultsPerPage;
              if(offset > count) {
                  int pages = count / maxResultsPerPage;
                  offset = pages * maxResultsPerPage;
              }
              return offset;
          }
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                ochytil Ondrej Chytil
                frank.rittinger Frank Rittinger
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: