ScriptNode addNode() updated to set the child name correctly

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10377 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mike Hatfield
2008-08-15 12:11:56 +00:00
parent 97971c2719
commit 18db34ffdb

View File

@@ -1303,7 +1303,8 @@ public class ScriptNode implements Serializable, Scopeable
public void addNode(ScriptNode node) public void addNode(ScriptNode node)
{ {
ParameterCheck.mandatory("node", node); ParameterCheck.mandatory("node", node);
nodeService.addChild(this.nodeRef, node.nodeRef, ContentModel.ASSOC_CONTAINS, ContentModel.ASSOC_CONTAINS); ChildAssociationRef childAssocRef = this.nodeService.getPrimaryParent(this.nodeRef);
nodeService.addChild(this.nodeRef, node.nodeRef, ContentModel.ASSOC_CONTAINS, childAssocRef.getQName());
reset(); reset();
} }