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
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.