Fixed ALF-4185: Patch patch.emailInviteAndNotifyTemplatesFolder fails

- Cycle through found templates (even if empty) and move them


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2010-09-07 18:01:04 +00:00
parent 30d182f645
commit 2151d7487d

View File

@@ -282,11 +282,15 @@ public class EmailTemplatesInviteAndNotifyFoldersPatch extends AbstractPatch {
//move template
String xpath = emaiemailTemplatesFolderXPath + "/cm:" + templateName;
List<NodeRef> templateNodeRef = searchService.selectNodes(emailTemplatesFolderNodeRef, xpath, null, namespaceService, false);
if (templateNodeRef != null)
List<NodeRef> templateNodeRefs = searchService.selectNodes(emailTemplatesFolderNodeRef, xpath, null, namespaceService, false);
for (NodeRef templateNodeRef : templateNodeRefs)
{
nodeService.moveNode(templateNodeRef.get(0), createdFolderNodeRef, ContentModel.ASSOC_CHILDREN,
nodeService.getPrimaryParent(templateNodeRef.get(0)).getQName());
QName qname = nodeService.getPrimaryParent(templateNodeRef).getQName();
nodeService.moveNode(
templateNodeRef,
createdFolderNodeRef,
ContentModel.ASSOC_CHILDREN,
qname);
}
return createdFolderNodeRef;