-
Bug
-
Resolution: Fixed
-
Neutral
-
None
-
-
Empty show more show less
-
Yes
-
Basel 41
-
3
If a 'Links to documents in the DAM' is included in a RichText Field in a content app, when this content is displayed as part of the page, the link is not rendered properly, the structure is like:
${link:{uuid:{795449d2-6c16-402e-9e8a-bbb101fe22bb},repository:{dam},path:{/tours/shark_brian_warrick_0824.JPG}}}
Same case, but rich text field in a component dialog is displayed properly.
Possible workaround: use method LinkUtil.convertLinksFromUUIDPattern()
This issue can be reproduced in travel-demo:
- Edit a tour in Tour App and introduce a 'Link to a DAM Document'.
- Publish the content
- Go to publicAuthor to see the tour information, the link format is not well formed, and DAM document cannot be downloaded.
Outcome
------------
The problem is due to the tour content (in the tours workspace) coming from a model and not from the node (in this case /travel/tour in website workspace) associated with the current rendering context. This basically means that the link resolution happening at https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/main/java/info/magnolia/jcr/util/ContentMap.java#222 does not happen for the model, hence the unresolved link. Afaics, there's no way for the Renderer to apply the same logic to the model, because that would mean knowing the internals of the model itself (in the specific case TourDetailModel has a getTour() method returning a Tour pojo which is retrieved from the tours workspace based on some request parameter).
All the above being said, it is the model responsibility in this case to resolve the links created with RTF component.
An alternative could be providing a templating function like resolveLinks(String) which could be used ad hoc directly in a template script. In our case at https://git.magnolia-cms.com/projects/MODULES/repos/demo-projects/browse/community/magnolia-travel-tours/src/main/resources/tours/templates/components/tourDetail.ftl#118 e.g.
<div class="body">${somefn.resolveLinks(tour.body)!}</div>
- mentioned in
-
Page Loading...