[MGNLUI-5260] multi-reference properties are broken - storing paths instead of UUID Created: 19/Jun/19  Updated: 21/Jun/19  Resolved: 20/Jun/19

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

Type: Bug Priority: Critical
Reporter: Christoph Meier Assignee: Mikaël Geljić
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0d
Time Spent: 0.75d
Original Estimate: Not Specified

Attachments: PNG File multi-references-are-bad.png     PNG File single-reference-good.png    
Issue Links:
Relates
relates to MAGNOLIA-7351 Setting a property to null via YAML c... Closed
causality
caused by MGNLCT-55 Generate a select field to limit entr... 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
Date of First Response:
Sprint: 6.1 Release Sprint

 Description   

When a CT has a reference property to another property, and it is marked as "multiple", then the generated app does not correctly configure the identifierToPathConverter node. Thiis causes links to be stored as paths instead of UUID's, which will cause problems in templating and other places.
(identifierToPathConverter has no "class" property)

When the CT property is not multiple, then the identifierToPathConverter is created correctly in the app.
(identifierToPathConverter has the correct "class" property: "info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter")

Given we have a CT with a CT-based app,
when the CT defines a filed with a reference to another type, and if the field allows multiple values:

# ...
model:
  nodeType: mt:tourOffice
  properties:
    - name: tourGuides
      type: reference:tourGuide
      multiple: true
# ...	  

Then the definition app claims a MINOR PROBLEM

Definition: tourOffices-app
Origin: /content-type-examples/apps/tourOffices-app.yaml
Details: Property [identifierToPathConverter] is set to null in definition.
Location: tourOffices-app/subApps/detail/editor/form/tabs/default/{name=name, i18n=false, required=true, type=String, fieldType=text}/tourGuides/tourGuides/identifierToPathConverter
Type: Source data processing problem
Severity: MINOR

When removing the multiple: true, there is no more problem.

This is a regression.

The given example has worked. (GIT: content-type-examples).
The above linked repos also contains bootstrpable data, which was produced months ago. In this (old) data, the multi-value content is stored like this:
[551d6005-20ec-4216-907b-87a0fd3f99b6, 58ba8e48-f404-4593-90b0-19116bcfed10].
When I create a new Tour office right now, the data now is stored with the node-path and not with the node-UUID (anymore).



 Comments   
Comment by Christopher Zimmermann [ 19/Jun/19 ]

Storing with path instead of UUID is a big problem. Is it just with multiple, or also single references?

Comment by Christoph Meier [ 19/Jun/19 ]

czimmermann - it happens only in the "multiple" case.
In the case of multiple: false - the reference is stored as UUID.

Comment by Dai Ha [ 21/Jun/19 ]

Verified on magnolia-dx-core-demo-webapp-6.1-20190620.142559-77.war. There is no problem in definition app and references saved as UUID.

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