Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3623

Division by zero in JcrThumbnailContainer with less than 3 assets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Neutral
    • None
    • 5.4.2
    • None
    • None

    Description

      When there are less than 3 assets opening the thumbnail view in the assets app results in a division by zero error.

      In info.magnolia.ui.workbench.thumbnail.JcrThumbnailContainer#setPageSize pageSize gets divided by 3, but since this in an integer division 2/3 = 0.

      Then in AbstractJcrContainer#updateOffsetAndCache you get a division by zero in this code:

      currentOffset = (index / (pageLength * cacheRatio)) * (pageLength * cacheRatio);

      (Maybe this calculation should be more like the one in AbstractJcrContainer#indexOfId, which has a similar statement, but with +1 in the division?)

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                breun Nils Breunese
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD