[MGNLUI-6798] JcrPreviewProvider resolves image path wrongly Created: 21/Jul/21  Updated: 14/Oct/21  Resolved: 04/Oct/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.10
Fix Version/s: 6.2.13

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Milan Divilek
Resolution: Fixed Votes: 0
Labels: maintenance, quickwin, ui-team-support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2021-07-21 at 16.22.22.png    
Issue Links:
Issue split
causality
documentation
to be documented by MGNLUI-6911 DOC: Update JCR preview definition Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Sprint: UI FW 37, UI FW 38
Story Points: 2

 Description   

Steps to reproduce

  1.  Open admincentral in demo
  2. Open the browser debugger tools to check the network activity
  3.  Open assets app and expand tours folder
  4. Check generated URLs

Expected results

URL to thumbnails should contain a valid format

Actual results

Extension is incorrectly processed and result is an URL containing two consecutive dots

Workaround

Set extension: jpg instead of default .jpg in the preview definition.

Development notes

// Crafting link manually;
// ImagingSupport should eventually create the link but it only supports the original variation so far
//  manual:  /.imaging/thumbnail/dam/374f8dbe-a8d7-4829-b9e7-3386a5ecb58f/blindtiger.png.jpg
// imaging:  /.imaging/default/dam/blindtiger.png/jcr:content.png
String imagePath = Text.escapePath(contextPath + "/" + preview.getServletPath() + "/" + generator + "/" + node.getSession().getWorkspace().getName() + "/" + imageNode.getIdentifier() + "/" + imageName + "." + preview.getExtension());
// Add cache fingerprint so that browser caches asset only until asset is modified.
Calendar lastModified = getLastModified(node);
imagePath = LinkUtil.addFingerprintToLink(imagePath, lastModified);



 Comments   
Comment by Roman Kovařík [ 14/Oct/21 ]

For release notes: thumbnail links are not created with two consecutive dots before extension anymore.

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