SHA-1930 : Unable to delete folder, when the folder contains shortcut link to the same folder

- Check link for PENDING_DELETE aspect before trying to delete it
   - Added unit test for case

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133020 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ramona Neamtu
2016-11-22 11:51:11 +00:00
parent a514f96d30
commit aa591b1362

View File

@@ -304,12 +304,15 @@ public class DocumentLinkServiceImpl implements DocumentLinkService, NodeService
for (NodeRef linkRef : linkNodeRefs) for (NodeRef linkRef : linkNodeRefs)
{ {
try try
{
if (!nodeService.hasAspect(linkRef, ContentModel.ASPECT_PENDING_DELETE))
{ {
nodeService.deleteNode(linkRef); nodeService.deleteNode(linkRef);
/* if the node was successfully deleted increment the count */ /* if the node was successfully deleted increment the count */
report.incrementDeletedLinksCount(); report.incrementDeletedLinksCount();
} }
}
catch (AccessDeniedException ex) catch (AccessDeniedException ex)
{ {
/* if the node could not be deleted add it to the report */ /* if the node could not be deleted add it to the report */