[MGNLUI-3990] Arrays in YAML usually require name to be specified Created: 18/Aug/16  Updated: 09/Mar/21  Resolved: 08/Mar/21

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

Type: Bug Priority: Neutral
Reporter: Tomáš Gregovský Assignee: Unassigned
Resolution: Workaround exists Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File 1.png    
Issue Links:
duplicate
duplicates MGNLUI-3404 Error rendering link field with no la... 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:

 Description   

While doing migration for corporate website and while migrating jcr configuration to yaml we had couple of multivalue fields defined like on attachment 1.png. The point is in categoriesFilter/field it was working without 'name' or 'label' property but after doing 'Download as YAML' and using this yaml definition dialog is not working. Technically dialog opens but without actions buttons and any dialog tab including and nexts after this multivalue field. And with error in log http://pastebin.com/NgJRhBzR

This is how field looks like after "Download as YAML":

        - name: categoriesFilter
          description:
          label: Show filter for
          class: info.magnolia.ui.form.field.definition.MultiValueFieldDefinition
          field:
            appName: categories
            fieldEditable: false
            targetWorkspace: category
            type: String
            class: info.magnolia.ui.form.field.definition.LinkFieldDefinition
            identifierToPathConverter:
              class: info.magnolia.ui.form.field.converter.BaseIdentifierToPathConverter

and when 'name' or 'label' is added into 'field' subnode then all is ok. Unfortunately when it happens is quite tough to find what is missing. Some better error message or not requiring this name will be cool.

BTW also documentation page https://documentation.magnolia-cms.com/display/DOCS/Multivalue+field#4dffdc6543cd4946b9e2d75165a6cef0 is using examples of jcr definition withotu name or label and then yaml with name...



 Comments   
Comment by Roman Kovařík [ 08/Mar/21 ]

To replicate JCR config, one have to use map notation:

categoriesFilter:
  description:
  ...

or specify name:

- name: categoriesFilter
  description:
   ...
Generated at Mon Feb 12 09:12:10 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.