MNT-13097 content reverted as well to head version if you delete last version of node

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133764 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Martin Muller
2016-12-15 16:39:38 +00:00
parent 3c8f669b98
commit b264e2c4ec
2 changed files with 49 additions and 36 deletions

View File

@@ -1366,12 +1366,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
try
{
// Create the restored node
restoredNodeRef = this.nodeService.createNode(
parentNodeRef,
assocTypeQName,
assocQName,
type,
props).getChildRef();
restoredNodeRef = this.nodeService.createNode(parentNodeRef, assocTypeQName, assocQName, type, props).getChildRef();
}
finally
{
@@ -1475,10 +1470,16 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
// Disable the VersionableAspect for this change though, we don't want
// to have this create a new version for the property change!
policyBehaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_VERSIONABLE);
this.nodeService.setProperty(nodeRef, ContentModel.PROP_VERSION_LABEL, headVersion.getVersionLabel());
// MNT-13097 Content will be reverted as well
revert(nodeRef, headVersion);
policyBehaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_VERSIONABLE);
try
{
this.nodeService.setProperty(nodeRef, ContentModel.PROP_VERSION_LABEL, headVersion.getVersionLabel());
// MNT-13097 Content will be reverted as well
revert(nodeRef, headVersion);
}
finally
{
policyBehaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_VERSIONABLE);
}
}
else
{