From 6170e10a5a0225063fdcbe87c371fe975d7e9571 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 2 Dec 2003 15:49:39 +0000 Subject: [PATCH] Try getting a child object by ID if it isn't found as property. This is due to the change in helma.objectmodel.db.Node.getProperty() where child nodes are only returned as properties if either accessName or groupby is specified. http://helma.org/bugs/show_bug.cgi?id=315 --- src/helma/scripting/rhino/HopObject.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helma/scripting/rhino/HopObject.java b/src/helma/scripting/rhino/HopObject.java index fa17b769..d1a11cc8 100644 --- a/src/helma/scripting/rhino/HopObject.java +++ b/src/helma/scripting/rhino/HopObject.java @@ -300,7 +300,12 @@ public class HopObject extends ScriptableObject implements Wrapper { if (id instanceof Number) { n = get(((Number) id).intValue(), this); } else if (id != null) { + // try to get as property first n = getFromNode(id.toString()); + // then try to get child object by id + if (n == null) { + n = jsFunction_getById(id); + } } // since we're calling Scriptable.get() methods, we'll get NOT_FOUND rather