Index: openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl,v diff -u -r1.43 -r1.44 --- openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 27 Oct 2014 16:39:06 -0000 1.43 +++ openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 7 Aug 2017 23:47:46 -0000 1.44 @@ -236,7 +236,14 @@ } } +# small compatibility function to avoid existence checks at runtime +if {[info commands ::nsf::strip_proc_name] eq ""} { + namespace eval ::nsf { + proc ::nsf::strip_proc_name {name} {return $name} + } +} + ad_proc -public db_qd_get_fullname {local_name {added_stack_num 1}} { Find the fully qualified name of the query } { @@ -252,7 +259,7 @@ # (eg. from bootstrap.tcl), in which case we return what we # were given if { [catch {string trimleft [info level [expr {-1 - $added_stack_num}]] ::} proc_name] } { - return $local_name + return [::nsf::strip_proc_name $local_name] } # If util_memoize, we have to go back up one in the stack @@ -261,6 +268,7 @@ set proc_name [info level [expr {-2 - $added_stack_num}]] } + set proc_name [::nsf::strip_proc_name $proc_name] set list_of_source_procs {ns_sourceproc apm_source template::adp_parse template::frm_page_handler rp_handle_tcl_request} # We check if we're running the special ns_ proc that tells us @@ -285,7 +293,7 @@ # added case for handling .vuh files which are sourced from # rp_handle_tcl_request. Otherwise, QD was forming fullquery path # with the assumption that the query resided in the - # rp_handle_tcl_request proc itself. (Openacs - DanW) + # rp_handle_tcl_request proc itself. (OpenACS - DanW) switch $proc_name { @@ -348,7 +356,7 @@ # check to see if a package proc is being called without # namespace qualification. If so, add the package qualification to the # proc_name, so that the correct query can be looked up. - # (Openacs - DanW) + # (OpenACS - DanW) set calling_namespace [string range [uplevel [expr {1 + $added_stack_num}] {namespace current}] 2 end] # db_qd_log QDDebug "calling namespace = $calling_namespace" @@ -697,18 +705,8 @@ } { # Find the index that we're looking at - set index [lindex $parsing_state 0] + lassign $parsing_state index node_list parsed_doc default_rdbms file_path - # Find the list of nodes - set node_list [lindex $parsing_state 1] - - # Parsed Doc Pointer - set parsed_doc [lindex $parsing_state 2] - - # Default RDBMS - set default_rdbms [lindex $parsing_state 3] - set file_path [lindex $parsing_state 4] - # BASE CASE if {[llength $node_list] <= $index} { # Clean up @@ -728,7 +726,7 @@ # Update the parsing state so we know # what to parse next - set parsing_state [list $index $node_list [lindex $parsing_state 2] $default_rdbms $file_path] + set parsing_state [list $index $node_list $parsed_doc $default_rdbms $file_path] # Parse the actual query from XML set one_query [db_qd_internal_parse_one_query_from_xml_node $one_query_xml $default_rdbms $file_path] @@ -830,6 +828,8 @@ ## Extra Utilities to Massage the system and Rub it in all the right ways ## ad_proc -private db_qd_internal_prepare_queryfile_content {file_content} { + Prepare raw .xql-file content form xml-parsing via quoting +} { set new_file_content ""