-
Bug
-
Resolution: Not an issue
-
Major
-
None
-
4.2.3
I found this working with (stk) categorization. A page that can have categories store uuid's to category nodes in the data workspace as a multi value property.
When you set only one category an array of one javax.jcr.Value instances will be set, and it will be a multi value property non the less. You can come back to it later and add more values.
But if you export this page to xml, it will be serialized as something like this:
<sv:property sv:name="categories" sv:type="String">
<sv:value>d7ba9d64-b7b8-4b93-8a3d-ecd14a049bb8</sv:value>
</sv:property>
This is exactly the way a single value property is stored. So when you reimport the xml, a single value property is created for this value.
When you try to add a value to it, you get:
2010-01-26 13:56:53,893 ERROR nfo.magnolia.module.admininterface.SaveHandlerImpl: Single-valued property can not be set to an array of values:
javax.jcr.ValueFormatException: Single-valued property can not be set to an array of values:property /tegenlicht/nieuws/2010/januari/wie-is-wi
at org.apache.jackrabbit.core.PropertyImpl.checkSetValue(PropertyImpl.java:244)
at org.apache.jackrabbit.core.PropertyImpl.setValue(PropertyImpl.java:646)
at org.apache.jackrabbit.core.PropertyImpl.setValue(PropertyImpl.java:629)
at info.magnolia.cms.core.DefaultNodeData.setValue(DefaultNodeData.java:504)
at info.magnolia.cms.core.DefaultContent.setNodeData(DefaultContent.java:351)
at info.magnolia.cms.util.NodeDataUtil.getOrCreateAndSet(NodeDataUtil.java:392)
.......
When you add more than one value before you export it to xml it works ok. The importer finds multiple values, and creates a multi value property accordingly.
This seems more of a jackrabbit, or even a specification bug, but perhaps it can be somehow cought in magnolia?
- is causing
-
MAGNOLIA-3968 Improve saveHandler for multiSelect controls to handle single-valued properties
- Closed