[MGNLUI-3523] Loading only one thumbnail causes exception Created: 12/Aug/15  Updated: 09/Mar/21  Resolved: 09/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 5.4
Fix Version/s: 5.4.x

Type: Bug Priority: Neutral
Reporter: Ilgun Ilgun Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2015-08-12 at 15.59.22.png     PNG File Screen Shot 2015-08-12 at 16.10.55.png     HTML File stacktrace    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

To reproduce it:

given(contacts-app).hasOnlyOneContact();
when(user).opensThumbnailView();
then(user).hitsException();

and

given(assets-app).hasOnlyOneContact();
when(user).opensThumbnailView();
then(user).hitsException();



 Comments   
Comment by Aleksandr Pchelintcev [ 13/Aug/15 ]

ThumbnailsLayout operates over ranges and sets the underlying container's page length according to the length of the currently displayed range of thumbnails.

When there's only one image displayed - the length of the range is zero (a span which contains only one point..) => cache page length is zero as well which leads to division by zero.

Ideally - 1 as a page length/active range length would be a more expected value and then no arithmetic exception would be thrown.

Comment by Roman Kovařík [ 09/Mar/21 ]

Cannot reproduce on latest https://demo.magnolia-cms.com/.magnolia/admincentral#app:dam:jcrBrowser;:tree:

Generated at Mon Feb 12 09:07:27 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.