Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3968

Improve saveHandler for multiSelect controls to handle single-valued properties

    XMLWordPrintable

    Details

      Description

      We are faced with the following problems, which are really 2 instances of the same problem:

      1. We changed a control in one of our dialogs to use multiselect rather than single-select (originally the customer wanted one category, then changed their mind and wanted multiple categories to be assignable to the content)

      2. We observed that data imported from XML had problems with the multiselect for categories

      The problem is that the multiselect control does not work if the node already contains a single-valued property of the same name.
      In case 1. the single-valued properties were created by the editors using the old dialog definition.
      In case 2. the single-valued properties were created by the XML-Import-Bug (see MAGNOLIA-3035)

      In both cases the behaviour is the same: when an editor wants to edit the content using the dialog, the existing (single-valued) property is not displayed in the multiselect control. If the user sets new values in the multiselect control, the dialog cannot be saved as there is an exception in the saveHandler when it finds the existing single-valued property.

      The solution has 2 parts:

      A) when loading the value in multiselect control, if a single-valued property is present, load it anyway and assume it is a solo element of a multi-valued property. It seems to me this should be handled by MAGNOLIA-2773, but is is not working in 4.4.2 EE.

      B) when storing the value, if a single-valued property is present, delete the property before storing, so that a new multi-valued property is created.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              runger Richard Unger
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response: