[MGNLUI-6435] DOC: Named MultiField with number as suffix causes the error: Saved data is not loaded Created: 03/Dec/20  Updated: 14/Dec/20  Resolved: 07/Dec/20

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

Type: Bug Priority: Major
Reporter: Sang Ngo Huu Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: multifield
Remaining Estimate: Not Specified
Time Spent: 16m
Original Estimate: Not Specified

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
Documentation update required:
Yes
Date of First Response:

 Description   

Steps to reproduce

  1. Create multifield with linkfield as field
  2. Add value, save, data is saved
  3. Edit that node again, data is not loaded
        multi2:
          label: multi2
          i18n: true
          $type: jcrMultiField
          description: >
            A multi field composed by simple fields and a composite one (address).
            Field layout can be changed by specifying a different layout definition
          itemProvider:
            $type: currentItemProvider
          field:
            label: linkField
            $type: linkField
            buttonSelectNewLabel: Select new ...
            buttonSelectOtherLabel: Select another ...
            datasource:
              $type: jcrDatasource
              workspace: contacts

Expected results

Linkfields are shown and bound with saved data

Actual results

Saved data is not loaded, there is no linkfields

Workaround

Setting orderHandler for multiField

orderHandler:
        class: info.magnolia.ui.editor.MultiFormDefinition$OrderHandlerDefinition$Noop


 Comments   
Comment by Sang Ngo Huu [ 07/Dec/20 ]

If we define a multifield field with number as suffix, for example: field1, field2. This will be conflicted to info.magnolia.ui.editor.ByIndexedChildNodes when storing data, then saved data is not loaded. So, we should mention this problem to documentation

Comment by Šimon Demočko [ 14/Dec/20 ]

re: Sang: Only specifically when using currentItemProvider, because with that the multi entries with indices modify the field name. When using jcrChildItemProvider (which is default), the field name is untouched and child item naming is not relevant.

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