Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 17 May 2003 10:04:18 -0000 1.29 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 7 Jul 2003 12:00:01 -0000 1.30 @@ -2547,7 +2547,20 @@ return $data } - oracle - + oracle { + set pre_sql $sql + set full_statement_name [db_qd_get_fullname $statement_name] + set sql [db_qd_replace_sql $full_statement_name $pre_sql] + + # insert tcl variable values (borrowed from Dan W - olah) + if {![string equal $sql $pre_sql]} { + set sql [uplevel 2 [list subst -nobackslashes $sql]] + } + + set data [db_string dummy_statement_name $sql] + return $data + } + nsodbc - default { error "$proc_name is not supported for this database." 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 -r1.29 -r1.30 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 29 Jun 2003 23:32:23 -0000 1.29 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 7 Jul 2003 12:00:01 -0000 1.30 @@ -537,7 +537,7 @@ ad_proc -public site_node_closest_ancestor_package { { -default "" } { -url "" } - package_key + package_keys } { Finds the package id of a package of specified type that is closest to the node id represented by url (or by ad_conn url).Note @@ -558,50 +558,50 @@ @param default The value to return if no package can be found @param current_node_id The node from which to start the search - @param package_key The type of the package for which we are looking + @param package_keys The type(s) of the package(s) for which we are looking @return package_id of the nearest package of the specified type (package_key). Returns $default if no such package can be found. } { if {[empty_string_p $url]} { - set url [ad_conn url] + set url [ad_conn url] } # Try the URL as is. if {[catch {nsv_get site_nodes $url} result] == 0} { - array set node $result - if { [string eq $node(package_key) $package_key] } { - return $node(package_id) - } + array set node $result + if { [lsearch -exact $package_keys $node(package_key)] != -1 } { + return $node(package_id) + } } - + # Add a trailing slash and try again. if {[string index $url end] != "/"} { - append url "/" - if {[catch {nsv_get site_nodes $url} result] == 0} { - array set node $result - if { [string eq $node(package_key) $package_key] } { - return $node(package_id) - } - } + append url "/" + if {[catch {nsv_get site_nodes $url} result] == 0} { + array set node $result + if { [lsearch -exact $package_keys $node(package_key)] != -1 } { + return $node(package_id) + } + } } - + # Try successively shorter prefixes. while {$url != ""} { - # Chop off last component and try again. - set url [string trimright $url /] - set url [string range $url 0 [string last / $url]] + # Chop off last component and try again. + set url [string trimright $url /] + set url [string range $url 0 [string last / $url]] - if {[catch {nsv_get site_nodes $url} result] == 0} { - array set node $result - if {$node(pattern_p) == "t" && $node(object_id) != "" && [string eq $node(package_key) $package_key] } { - return $node(package_id) - } - } + if {[catch {nsv_get site_nodes $url} result] == 0} { + array set node $result + if {$node(pattern_p) == "t" && $node(object_id) != "" && [lsearch -exact $package_keys $node(package_key)] != -1 } { + return $node(package_id) + } + } } - + return $default }