$sys.item.hasNode("childName") throws exception

I’m working on a shared template that is capable of rendering two different content types. They’re almost identical except that one content type has a child table - assume it’s called “childTable”.

If, in my template, I call $sys.item.hasNode(“childTable”) when rendering the content type with that child table, it works fine, however when rendering the other content type without that table, it throws an exception:

javax.jcr.PathNotFoundException: Child childTable was not found

This seems like a violation of the contract defined by com.percussion.services.contentmgr.IPSNode. According to the javadocs, that method only throws “RepositoryException” if an unknown error occurs. Otherwise it should simply return true or false.

Bummer. My workaround is to branch on $sys.item.getDefinition().getInternalName() using the names of the content types. Is this a known issue? If so, are there plans to fix it in the next release?




It would seem this is a bug. Could you please open a TAR with Tech Support, so that we can track the resolution (and associate the bug with you).