[MGNLUI-6289] Provide compatibility to asset links Created: 08/Oct/20  Updated: 02/Feb/21  Resolved: 02/Feb/21

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

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Sang Ngo Huu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: 1d 17m
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by MGNLDAM-927 CLONE - Provide compatibility to asse... Closed
is cloned by MGNLUI-6517 Provide PreviewComponent for a binary... Open
Problem/Incident
is caused by MGNLUI-5840 Compatibility: asset type in custom c... Closed
Relates
relates to MGNLUI-5979 in 6.2.2 There is no preview for link... Closed
relates to MGNLUI-6527 Image embedded with RTE in the old pa... Closed
causality
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:
Epic Link: UI framework: migration and backwards compatibility
Sprint: UI FW 19, UI FW 20, UI FW 21
Story Points: 2

 Description   

Scenario:
Due to MGNLUI-5840, asset references have been stored without the prefix jcr:. When opening their corresponding dialog, which is declared with the old syntax, these references are throwing an error like the following:

java.lang.IllegalArgumentException: 507b0635-d1b1-49ab-99d4-451751e0fd08 is not a valid ItemKey

Removing targetWorkspace property from the definition makes it work ok but, unfortunately, preview is not shown as reported in MGNLUI-5979.
Steps to reproduce (Magnolia 6.2.3)

  1. Create a component whose dialog contain following field:
    - name: cinemagraph
              class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
              required: true
              targetWorkspace: dam
              appName: assets
              identifierToPathConverter:
                class: info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter
              contentPreviewDefinition:
                contentPreviewClass: info.magnolia.dam.app.ui.field.DamFilePreviewComponent 
  2. Store any link by using the dialog (Note the preview is shown in the dialog) and remove the jcr: prefix from the reference through JCR app (Forcing MGNLUI-5840)
  3. Open the component dialog again and see the error.
  4. Remove targetWorkspace property from the definition and open the component dialog again. It works ok and no error is thrown now but preview is not shown in the dialog

Expected results
There should be compatibility for assets that were stored without jcr: prefix.


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