[MGNLREST-310] Delivery endpoint API does not update the path for links in richTextFiled when assets are moved Created: 26/May/21 Updated: 03/Jun/21 Resolved: 02/Jun/21 |
|
| Status: | Closed |
| Project: | Magnolia REST Framework |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Bartosz Staryga | Assignee: | Oanh Thai Hoang |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | VN-Analysis, maintenance | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 0.25d | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| 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: | |||||||||
| Sprint: | Maintenance 61 | ||||||||
| Story Points: | 1 | ||||||||
| Description |
Steps to reproduce
Expected resultsThe path returned in ${link...} should be updated to the new placement of the asset Actual resultsThe old path is returned WorkaroundDevelopment notes |
| Comments |
| Comment by Bartosz Staryga [ 26/May/21 ] |
|
The same behaviour happens when linking pages and page is moved. |
| Comment by Oanh Thai Hoang [ 02/Jun/21 ] |
|
Hi bstaryga, cc fgrilli, just wanna ask is this config work for you
In rest delivery, magnolia has one feature to get correct link from reference asset. See https://docs.magnolia-cms.com/product-docs/Developing/API/REST-API/Delivery-endpoint-API/Delivery-endpoint-API-v2/Resolving-references-with-the-delivery-endpoint.html#_resolving_asset_links_in_rich_text_fields
Here is example config based on your pages.yaml restenpoint in "test" light dev. class: info.magnolia.rest.delivery.jcr.v2.JcrDeliveryEndpointDefinition workspace: website limit: 100 depth: 10 nodeTypes: - mgnl:page childNodeTypes: - mgnl:area - mgnl:component references: - name: referenceWithRichText propertyName: image referenceResolver: class: info.magnolia.rest.reference.link.RichTextLinkResolverDefinition Output before "image":"<p><a href=\"${link:{uuid:{92f38185-67f6-4d96-884b-b632a1edd942},repository:{dam},path:{/Screen-Shot-2021-06-02-at-09.18.png}}}\">Screen-Shot-2021-06-02-at-09.18.png</a></p>\n" Output after resolver config "image":"<p><a href=\"http://localhost:8080/dam/jcr:92f38185-67f6-4d96-884b-b632a1edd942/Screen%20Shot%202021-06-02%20at%2009.18.png\">Screen-Shot-2021-06-02-at-09.18.png</a></p>\n" So you have the real asset link here: *http://localhost:8080/dam/jcr:92f38185-67f6-4d96-884b-b632a1edd942/Screen%20Shot%202021-06-02%20at%2009.18.png*
|
| Comment by Bartosz Staryga [ 02/Jun/21 ] |
|
oanh.thai it actually might do the trick |
| Comment by Oanh Thai Hoang [ 02/Jun/21 ] |
|
Hi bstaryga. Glad to hear it actually works for you. That new resolver has been introduced since Rest 2.2.3 and released with Magnolia 6.2.4. More details in https://jira.magnolia-cms.com/browse/MGNLREST-196.
Since that resolver can help to resolve real link for pages and dam as well so I guess I can close this ticket as won't fix. Feel free to reopen it again if you have any idea. Thank you
|