Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -N -r1.68 -r1.69 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 10 Jan 2007 21:22:12 -0000 1.68 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 9 Mar 2007 16:45:00 -0000 1.69 @@ -257,12 +257,26 @@ nsv_array reset site_node_url_by_object_id [list] nsv_array reset site_node_url_by_package_key [list] - set root_node_id [db_string get_root_node_id {} -default {}] + set root_node_id [site_node::get_root_node_id] if { $root_node_id ne "" } { site_node::update_cache -sync_children -node_id $root_node_id } } +ad_proc -public site_node::get_root_node_id { +} { + Returns the root node id of the site +} { + util_memoize [list site_node::get_root_node_id_not_cached] +} + +ad_proc -public site_node::get_root_node_id_not_cached { +} { + Returns the root node id of the site +} { + return [db_string get_root_node_id {} -default {}] +} + ad_proc -private site_node::update_cache { {-sync_children:boolean} {-node_id:required} @@ -486,6 +500,7 @@ } } + error "site node not found at url \"$url\"" } @@ -497,6 +512,7 @@ @author Peter Marklund } { set url_no_trailing [string trimright $url "/"] + return [nsv_exists site_nodes "$url_no_trailing/"] }