git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6039 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast 2007-06-20 18:54:15 +00:00
parent ecd81e37a2
commit 5120da0dc6

View File

@ -116,7 +116,16 @@ public class ScriptActionExecuter extends ActionExecuterAbstractBase
NodeRef spaceRef = this.serviceRegistry.getRuleService().getOwningNodeRef(action);
if (spaceRef == null)
{
spaceRef = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();
// the actionedUponNodeRef may actually be a space
if (this.serviceRegistry.getDictionaryService().isSubClass(
nodeService.getType(actionedUponNodeRef), ContentModel.TYPE_FOLDER))
{
spaceRef = actionedUponNodeRef;
}
else
{
spaceRef = nodeService.getPrimaryParent(actionedUponNodeRef).getParentRef();
}
}
if (this.scriptLocation != null || (scriptRef != null && nodeService.exists(scriptRef) == true))