From 6f99d9435792cac9ac04ae2c480ebe66e8b9b912 Mon Sep 17 00:00:00 2001 From: Roxana Lucanu-Ghetu Date: Fri, 17 Jun 2016 12:25:22 +0300 Subject: [PATCH] Changed check to throw exception when we try to create records from different types other than cm:folder --- .../rma/type/RecordsManagementContainerType.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java index cfbb51f0be..14340ae938 100644 --- a/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java +++ b/rm-community/rm-community-repo/source/java/org/alfresco/module/org_alfresco_module_rm/model/rma/type/RecordsManagementContainerType.java @@ -148,17 +148,15 @@ public class RecordsManagementContainerType extends BaseBehaviourBean } else { - // Throw exception if the type is not cm:content - if (!ContentModel.TYPE_FOLDER.equals(childType) && - !dictionaryService.isSubClass(childType, ContentModel.TYPE_CONTENT)) - { - throw new AlfrescoRuntimeException("Record can't be created from this type."); - } - // We need to automatically cast the created folder to RM type if it is a plain folder // This occurs if the RM folder has been created via IMap, WebDav, etc if (!nodeService.hasAspect(child, ASPECT_FILE_PLAN_COMPONENT)) { + // Throw exception if the type is not cm:folder + if (!ContentModel.TYPE_FOLDER.equals(childType)) + { + throw new AlfrescoRuntimeException("Record can't be created from this type."); + } // check the type of the parent to determine what 'kind' of artifact to create NodeRef parent = childAssocRef.getParentRef(); QName parentType = nodeService.getType(parent);