[HASSETS-14] Hybrid assets: damfn.getAssetLink() doesn't work Created: 08/Sep/20  Updated: 17/Jan/24  Resolved: 17/Jan/24

Status: Closed
Project: Hybrid Assets
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.1

Type: Bug Priority: Critical
Reporter: Thomas Comiotto Assignee: Lars Fischer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File damfn1.png     PNG File damfn2.png     PNG File damfn3.png    
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   

In our templates we use damfn.getAssetLink() a lot, which is not supported by hybrid assets it seems.

With hybrid assets, getAssetLink() is handled by JCRAssetProvider.getLink(Asset asset) which returns a dead link like this:

/dam/jcr:c1b468af-4f06-4553-a59d-d62b305f0a80/thisisnotatest-62167c0c-9a8e-4e92-bf82-c1fe4e8d2bb8-1597416108581.jpg

Hybrid assets should support the complete set of damfn functions. It will be very time consuming for us changing all our templates to only use a damfn subset. Having said that,  what's the recommended way of using damfn with hybrid assets?

 

 

 

 



 Comments   
Comment by Andrew Warinner [ 17/Sep/20 ]

We will test damfn.getAssetLink() in a simple component and attach the component here.

Comment by Lars Fischer [ 17/Jan/24 ]

Tested with 2.0.1 and the link works.

[#if content.hybridImage?has_content]
  <p>
    [#assign hybridAssetLink = damfn.getAssetLink(content.hybridImage)!""]
    This is the hybrid asset link: <br/> ${hybridAssetLink}
  </p>
  <img src='${hybridAssetLink!}'
       class='img-responsive'
       alt='${content.caption!"image"}'>
[/#if] 

Comment by Lars Fischer [ 17/Jan/24 ]

Also works when directly selecting from S3 and not from Magnolia DAM:

 

Comment by Lars Fischer [ 17/Jan/24 ]

Tested with Magnolia DAM and S3 directly.

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