mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Name duplicate detection is not done at the end of the transaction, so late setting of
cm:name has to be avoided. This fix makes the CopyService use the auto-assigned cm:name before doing the copy. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3621 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -586,13 +586,20 @@ public class FileFolderServiceImpl implements FileFolderService
|
||||
}
|
||||
else
|
||||
{
|
||||
// copy the node
|
||||
targetNodeRef = copyService.copy(
|
||||
sourceNodeRef,
|
||||
targetParentRef,
|
||||
assocRef.getTypeQName(),
|
||||
qname,
|
||||
true);
|
||||
try
|
||||
{
|
||||
// copy the node
|
||||
targetNodeRef = copyService.copy(
|
||||
sourceNodeRef,
|
||||
targetParentRef,
|
||||
assocRef.getTypeQName(),
|
||||
qname,
|
||||
true);
|
||||
}
|
||||
catch (DuplicateChildNodeNameException e)
|
||||
{
|
||||
throw new FileExistsException(targetParentRef, newName);
|
||||
}
|
||||
}
|
||||
|
||||
// Only update the name if it has changed
|
||||
|
Reference in New Issue
Block a user