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.41.2.40 -r1.41.2.41 --- openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 17 Aug 2021 14:38:46 -0000 1.41.2.40 +++ openacs-4/packages/xotcl-core/tcl/06-package-procs.tcl 19 Nov 2021 19:30:53 -0000 1.41.2.41 @@ -777,31 +777,38 @@ return $form_item_ids } ::xo::Package instproc get_parameter {attribute {default ""}} { - set package_id ${:id} - set parameter_obj [::xo::parameter get_parameter_object \ - -parameter_name $attribute \ - -package_id $package_id \ - -retry false] - set success 0 + # set package_id ${:id} + # set parameter_obj [::xo::parameter get_parameter_object \ + # -parameter_name $attribute \ + # -package_id $package_id \ + # -retry false] + # set success 0 - if {$parameter_obj ne "" && [$parameter_obj set scope] ne "global"} { - set value [$parameter_obj get -package_id $package_id] - #ns_log notice "core: get_param for $attribute after GET: [$parameter_obj serialize] -> '$value'" - #if {$value ne "" || [$parameter_obj set __success]} {return $value} - # - # The returned '$value' might be a value set for the actual - # package instance, or the default for the package_parameter as - # defined by the package parameter definition in the XML file. If - # the value was not specified explicitly, and the provided - # default for this command is not empty, return the provided - # default. - # - if {![$parameter_obj set __success] && $value eq "" && $default ne ""} { - return $default - } else { - return $value - } + # if {$parameter_obj ne "" && [$parameter_obj set scope] ne "global"} { + # set value [$parameter_obj get -package_id $package_id] + # #ns_log notice "core: get_param for $attribute after GET: [$parameter_obj serialize] -> '$value'" + # #if {$value ne "" || [$parameter_obj set __success]} {return $value} + # # + # # The returned '$value' might be a value set for the actual + # # package instance, or the default for the package_parameter as + # # defined by the package parameter definition in the XML file. If + # # the value was not specified explicitly, and the provided + # # default for this command is not empty, return the provided + # # default. + # # + # if {![$parameter_obj set __success] && $value eq "" && $default ne ""} { + # return $default + # } else { + # return $value + # } + # } + set value [::parameter::get -package_id ${:id} -parameter $attribute -default $default] + if {$value ne $default} { + return $value } + # + # make a second attempt from the global value. + # return [parameter::get_global_value \ -package_key ${:package_key} \ -parameter $attribute \ Index: openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl,v diff -u -r1.24.2.15 -r1.24.2.16 --- openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl 2 Nov 2021 09:47:04 -0000 1.24.2.15 +++ openacs-4/packages/xotcl-core/tcl/06-param-procs.tcl 19 Nov 2021 19:30:54 -0000 1.24.2.16 @@ -280,6 +280,10 @@ [::xo::cc package_id] : [ns_conn isconnected] ? [ad_conn package_id] : $::acs::kernel_id}] } + ns_log notice "deprecated xo::parameter get -parameter $parameter called (replaced by ::parameter::get)" + return [::parameter::get -parameter $parameter -package_id $package_id \ + {*}[expr {[info exists default] ? [list -default $default] : ""}]] + set parameter_obj [:get_parameter_object \ -parameter_name $parameter \ -package_id $package_id \ @@ -310,10 +314,13 @@ [::xo::cc package_id] : [ns_conn isconnected] ? [ad_conn package_id] : $::acs::kernel_id}] } + ns_log notice "deprecated xo::parameter set_value -parameter $parameter called " \ + "(replaced by ::parameter::set_value)" + return [::parameter::set_value -package_id $package_id -parameter $parameter -value $value] + set parameter_obj [:get_parameter_object -parameter_name $parameter -package_id $package_id] if {$parameter_obj ne ""} { $parameter_obj set_per_package_instance_value $package_id $value - ::parameter::set_value -package_id $package_id -parameter MenuBar -value $value } else { error "could not create parameter object" } @@ -337,7 +344,8 @@ } parameter instproc set_per_package_instance_value {package_id value} { set array [:per_package_id_name $package_id] - #ns_log notice "[list nsv_dict set $array $package_id ${:parameter_name} $value]" + ns_log notice "[list nsv_dict set $array $package_id ${:parameter_name} $value]" + xo::show_stack nsv_dict set $array $package_id ${:parameter_name} $value } parameter instproc clear_per_package_instance_value {package_id} { @@ -460,7 +468,7 @@ } } - parameter initialize_parameters + #parameter initialize_parameters # # For the time being: catch changed parameter values