Forum OpenACS Development: Re: WARNING: site_node::get_children returns incorrect result set

Posted by Lars Pind on

If you would supply an automated test case that tests site_node::get_children, both the things that do work as expected, and at least one test that fails because it returns the node itself, I'll be happy to fix.


# Shows bug in site_node::get_children - reurns passed node
aa_register_case -cats {
} -on_error {
    site_node::get_children returns root node!
} test_for_root_node_inclusion {
    @author Randy O'Meara
} {
    # Start with a known site-map entry
    set node_id [site_node::get_node_id -url "/"]

    set child_node_ids [site_node::get_children \
			    -all \
			    -element node_id \
			    -node_id $node_id]

    # lsearch returns '-1' if not found
    aa_equals "site_node::get_children" [lsearch -exact $child_node_ids $node_id] -1