Index: openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 8 Jan 2009 16:03:17 -0000 1.17 +++ openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 25 Jan 2009 10:49:17 -0000 1.18 @@ -94,7 +94,7 @@ -keep_cc $keep_cc \ -package_id $package_id -user_id $user_id \ -parameter $parameter -url $url -actual_query $actual_query - + if {[info exists original_url_and_query]} { ::xo::cc original_url_and_query $original_url_and_query } Index: openacs-4/packages/xotcl-core/tcl/context-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/context-procs.tcl,v diff -u -r1.45 -r1.46 --- openacs-4/packages/xotcl-core/tcl/context-procs.tcl 23 Nov 2008 18:08:45 -0000 1.45 +++ openacs-4/packages/xotcl-core/tcl/context-procs.tcl 25 Jan 2009 10:49:17 -0000 1.46 @@ -178,10 +178,22 @@ ConnectionContext proc require_package_id_from_url {{-package_id 0} url} { # get package_id from url in case it is not known - if {$package_id == 0} { + if {$package_id == 0 || ![info exists ::ad_conn(node_id)]} { array set "" [site_node::get_from_url -url $url] set package_id $(package_id) #my msg "--i setting pkg to $package_id" + # + # The following should not be necessary, but is is here for + # cases, where some oacs-code assumes wrongly it is running in a + # connection thread (e.g. the site master requires to have a + # node_id and a url accessible via ad_conn) + # + if {![info exists ::ad_conn(node_id)]} { + set ::ad_conn(node_id) $(node_id) + set ::ad_conn(url) $url + set ::ad_conn(extra_url) [string range $url [string length $(url)] end] + } + } return $package_id } @@ -245,6 +257,11 @@ ::xo::cc set_user_id $user_id ::xo::cc process_query_parameter } + if {![info exists ::ad_conn(charset)]} { + set ::ad_conn(charset) [lang::util::charset_for_locale $locale] + set ::ad_conn(language) [::xo::cc lang] + set ::ad_conn(file) "" + } } ConnectionContext instproc lang {} { return [string range [my locale] 0 1] @@ -259,10 +276,14 @@ } else { my set user_id 0 my set untrusted_user_id 0 + array set ::ad_conn [list user_id $user_id untrusted_user_id $user_id session_id ""] } } else { my set user_id $user_id my set untrusted_user_id $user_id + if {![info exists ::ad_conn(user_id)]} { + array set ::ad_conn [list user_id $user_id untrusted_user_id $user_id session_id ""] + } } }