[MGNLUI-6126] LinkField: Error if linked by path but field expects ID and vice versa, and deleted target should not render field empty Created: 11/Aug/20  Updated: 13/Jul/21  Resolved: 15/Oct/20

Status: Closed
Project: Magnolia UI
Component/s: dialogs, forms
Affects Version/s: 6.2.2
Fix Version/s: 6.2.4

Type: Bug Priority: Major
Reporter: Christian Ringele Assignee: Aleksandr Pchelintcev
Resolution: Fixed Votes: 0
Labels: maintenance
Remaining Estimate: Not Specified
Time Spent: 0.85h
Original Estimate: Not Specified

Issue Links:
Cloners
is cloned by MGNLUI-6257 LinkFieldDefinitionConverter assumes ... Closed
is cloned by MGNLDAM-905 Changing value to null in damLinkFiel... Closed
Problem/Incident
causes MTE-123 Redirect template dialog should store... Closed
relation
is related to MGNLUI-6774 DOC: Link field changed formats in 6.2.4 Closed
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
Release notes required:
Yes
Date of First Response:
Epic Link: Improve Content Linking
Sprint: Maintenance 27, Maintenance 28, Maintenance 29, Maintenance 30
Story Points: 5

 Description   

Situation:

  • In JCR is linked by path, but field expects by id
  • Or vice versa: In JCR is linked by id, but field expects by path
  • This can happen when changing the field's config, but still have old content. Migrations, try outs, artefact data etc

Problem:

  • In both cases one can not open the dialog at all! => the author can not change it
  • In the past one just saw the plain property value.
  • In JCR is linked by path, but field expects by id
Caused by: javax.jcr.RepositoryException: Not an absolute path: 5c2c69ec-925f-4aca-9321-a143a4b9b1d2
  • In JCR is linked by id, but field expects by path
Caused by: java.lang.IllegalArgumentException: /travel/tour-type
	at org.apache.jackrabbit.core.id.NodeId.<init>(NodeId.java:128) ~[jackrabbit-core-2.20.0.jar:2.20.0]

Solution:

About path vice versa:

  • If the stored value can not be resolved, let the dialog open.
  • Show the value as it is stored

About the linked node is deleted:

  • The field shows empty! This is not good as the author doe snot see what the link was/where it linked to.
  • The field should show then the stored value, and maybe communicate that the target node is not resolvable.


 Comments   
Comment by Teresa Miyar [ 30/Sep/20 ]

The error seems to be here:
here should set the default to info.magnolia.ui.editor.converter.JcrNodeToPathConverter and not to JcrNodeToIdentifierConverter
https://git.magnolia-cms.com/projects/PLATFORM/repos/ui.pub/browse/magnolia-ui-framework-compatibility/src/main/java/info/magnolia/ui/form/field/definition/migration/LinkFieldDefinitionConverter.java#148

Comment by Federico Grilli [ 27/Oct/20 ]

Follow-up ticket for an issue found in QA MGNLDAM-905

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