ALF-11259 Disable the VersionableAspect before updating the version label property on a node, when deleting the current version (plus test)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31631 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-11-02 02:58:45 +00:00
parent 053f4e691a
commit 0484671e8f
3 changed files with 75 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy;
import org.alfresco.repo.policy.PolicyScope;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.version.common.VersionHistoryImpl;
@@ -1368,6 +1369,9 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
if (headVersion != null)
{
// Reset the version label property on the versionable node to new head version
// 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());
}
else