[MGNLUI-6662] DOC: Multi value field behavior changed Created: 16/Apr/21  Updated: 12/May/21  Resolved: 12/May/21

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

Type: Improvement Priority: Neutral
Reporter: Boris Faniuk Assignee: Ashraf Khamis
Resolution: Done Votes: 0
Labels: external
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File 6.2.7-multifield-error.txt    
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)
Date of First Response:
Epic Link: UI framework implementation
Sprint: UI FW 28
Story Points: 2

 Description   

Hello!
We had previously used the following structure

label: Composite Field
$type: compositeField
  itemProvider:
    $type: jcrChildNodeProvider
properties:
  tags:
    label: 'Page Tags'
    $type: jcrMultiValueField
    itemProvider:
      $type: jcrChildNodeProvider
    field:
      label: ''
      $type: textField

After the latest changes ( presumably introduced by this commit ) this doesn't work any more and fails with the attached stacktrace.

We managed to get it working by removing the second instance of jcrChildNodeProvider:

label: Composite Field
$type: compositeField
itemProvider:
  $type: jcrChildNodeProvider
properties:
  tags:
    label: 'Page Tags'
    $type: jcrMultiValueField
#    itemProvider:
#      $type: jcrChildNodeProvider
    field:
      label: ''
      $type: textField

Probably makes sense to clarify this confusion in the doc (or release notes).
Would be great to list the correct options to combine composite field with multi value field.



 Comments   
Comment by Ashraf Khamis [ 12/May/21 ]

Hi Boris,

The first configuration is incorrect. The item provider for JcrMultiValueFieldDefinition has to be an instance of info.magnolia.ui.editor.JcrPropertyProvider$Definition. You would probably not want to manually configure an item provider for JcrMultiValueFieldDefinition at all.

I added a warning to the itemProvider property at https://docs.magnolia-cms.com/product-docs/Templating/Dialog-definition/Field-definition/List-of-fields/Multi-field.html to advise against using JcrMultiValueFieldDefinition with any item provider other than the default JcrPropertyProvider.

Best,

Ashraf

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