From c8a571a41c0b7bc65a08459ff8af59bb6c5b4aa3 Mon Sep 17 00:00:00 2001 From: Ana Bozianu Date: Wed, 3 May 2017 17:17:18 +0300 Subject: [PATCH] RM-5012 - added extra check to not add identifier twice --- .../module/org_alfresco_module_rm/record/RecordUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordUtils.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordUtils.java index 9cf6fbad05..c8fa357596 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordUtils.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/record/RecordUtils.java @@ -65,6 +65,12 @@ public class RecordUtils // get the record name String name = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME); + // skip this step if the record name already contains the identifier + if(name.contains(" (" + recordId + ")")) + { + return; + } + // rename the record int dotIndex = name.lastIndexOf('.'); String prefix = name;