-
Bug
-
Resolution: Fixed
-
Critical
-
1.0
-
None
-
None
2013-06-13 16:18:27,925 ERROR info.magnolia.cms.core.version.BaseVersionManager : failed to copy versionable node to version store, reverting all changes made in this session
2013-06-13 16:18:27,925 ERROR gnolia.ui.framework.action.MarkNodeAsDeletedAction: Could not execute command operation.
info.magnolia.ui.api.action.ActionExecutionException: org.apache.commons.lang.exception.NestableException: Exception during executing command
at info.magnolia.ui.framework.action.AbstractCommandAction.execute(AbstractCommandAction.java:167)
This is due to the Reference property. Linking a Node using a reference involve integrity check (make a version of a Asset without having the original node already versioned will throw Integrity exception).
Solution is to use Weak reference, that do not required integrity check.
Strange is that the asset node type definition includes :
<propertyDefinition name="master" requiredType="WeakReference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false" isFullTextSearchable="false" isQueryOrderable="false"/>
but this is not taken into account when doing: workspace.copy(..
We have to explicitly ask for a weak reference:
Value refValue = copyNode.getSession().getValueFactory().createValue(originalNode, true);
copyNode.setProperty(DamNodeTypes.Asset.MASTER, refValue);