Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-5327

Switchable field won't remove a previously persisted property when saving the second time around

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Neutral Neutral
    • None
    • 6.2
    • framework
    • None

      Switchable field won't remove a previously persisted property when saving the second time around or more.

      Ideally the save operation should just re-create the node in such case and not manually dig into which property to keep and which to remove.

      To reproduce use this configuration, for instance

      switchable:
                label: switchable
                class: info.magnolia.ui.field.ConfiguredSwitchableFieldDefinition
                field:
                  $type: radioButtonGroupField
                  datasource:
                    $type: optionListDatasource
                    options:
                      - name: foo
                        value: foo
                      - name: bar
                        value: bar
                itemProvider:
                  $type: fetchJcrSubNodeProvider
                forms:
                  - name: foo
                    properties:
                      foo:
                        label: foo
                        $type: textField
                  - name: bar
                    properties:
                      bar:
                        label: bar
                        $type: richTextField
      

      This is how data looks like in JCR after having first chosen bar and then foo. The ideal behavior would be to just have the latest saved value, foo in this case

        Acceptance criteria

              Unassigned Unassigned
              fgrilli Federico Grilli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: