[
http://jira.magnolia-cms.com/browse/MAGNOLIA-3035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=26328#action_26328
]
Grégory Joseph commented on MAGNOLIA-3035:
------------------------------------------
http://n4.nabble.com/Preserve-multi-value-properties-td1126162.html
> Multivalue properties with one value become single value properties after
> xml export -> import
> -----------------------------------------------------------------------------------------------
>
> Key: MAGNOLIA-3035
> URL: http://jira.magnolia-cms.com/browse/MAGNOLIA-3035
> Project: Magnolia
> Issue Type: Bug
> Components: core
> Affects Versions: 4.2.3
> Reporter: Ernst Bunders
> Assignee: Philipp Bärfuss
>
> 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?
>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------