[MGNLDAM-299] DamFilePreviewComponent will fail on assets with short filenames Created: 02/Sep/13  Updated: 20/Nov/13  Resolved: 20/Nov/13

Status: Closed
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: 1.0.2
Fix Version/s: 1.1, 1.2

Type: Bug Priority: Major
Reporter: Will Scheidegger Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnolia CE 5.0.4


Attachments: Text File dam_short_filenames.patch     PNG File p1.png    
Template:
Patch included:
Yes
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   

Steps to reproduce:

  • create an image file with a 2 letter filename, e.g. use the attached "p1.png"
  • upload this file to the DAM (everything's fine so far)
  • select this file in some dialog (e.g. component dialog)
    => the file will not be displayed in the preview
    => the log will show a NPE

When you debug this, you'll see that the problem in fact is not a NPE, but "java.lang.IllegalArgumentException: Prefix string too short" on DamFilePreviewComponent line 163.

Workaround: Once you make sure, that the filename of the temp file is at least 4 letters long, things work fine. The attached patch does this, but it might not be the prettiest way...



 Comments   
Comment by Eric Hechinger [ 20/Nov/13 ]

Solved by commit done in MGNLDAM-292

Generated at Mon Feb 12 04:58:28 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.