From d80f8c136a5c793f126351b10c4945e7a9fd63f4 Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Thu, 17 Nov 2011 10:18:45 +0000 Subject: [PATCH] ALF-8882 Edit Online: Modifier and Modified date are changed even no changes were applied - needed to turn off ASPECT_AUDITABLE on removeProperty which is called on unlock - added code to not enable this aspect early if nested calls were made (this is not done, but is safer this way) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32047 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/public-services-context.xml | 1 + .../audit/DisableAuditableBehaviourInterceptor.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config/alfresco/public-services-context.xml b/config/alfresco/public-services-context.xml index d233b8c133..20077ca526 100644 --- a/config/alfresco/public-services-context.xml +++ b/config/alfresco/public-services-context.xml @@ -94,6 +94,7 @@ setProperty + removeProperty diff --git a/source/java/org/alfresco/repo/audit/DisableAuditableBehaviourInterceptor.java b/source/java/org/alfresco/repo/audit/DisableAuditableBehaviourInterceptor.java index 638146487e..a9da506a2e 100644 --- a/source/java/org/alfresco/repo/audit/DisableAuditableBehaviourInterceptor.java +++ b/source/java/org/alfresco/repo/audit/DisableAuditableBehaviourInterceptor.java @@ -83,9 +83,15 @@ public class DisableAuditableBehaviourInterceptor implements MethodInterceptor methodNames.contains(methodName) && (arg1 == null || argumentQNameValues.contains(arg1))) { + Set disabledNodeRefs = new HashSet(); // Avoid nested calls that enable the aspect early for (NodeRef nodeRef : nodes) { - behaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE); + if (!disabledNodeRefs.contains(nodeRef) && + behaviourFilter.isEnabled(nodeRef, ContentModel.ASPECT_AUDITABLE)) + { + behaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE); + disabledNodeRefs.add(nodeRef); + } } try { @@ -95,7 +101,10 @@ public class DisableAuditableBehaviourInterceptor implements MethodInterceptor { for (NodeRef nodeRef : nodes) { - behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE); + if (disabledNodeRefs.contains(nodeRef)) + { + behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE); + } } } }