Index: openacs-4/packages/acs-bootstrap-installer/installer.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/acs-bootstrap-installer/installer.tcl 11 Jul 2018 07:31:22 -0000 1.31 +++ openacs-4/packages/acs-bootstrap-installer/installer.tcl 3 Sep 2024 15:37:30 -0000 1.32 @@ -12,30 +12,30 @@ # Return a header for an installation page, suitable for ns_writing. # This procedure engages the installer mutex, as every installer page is a critical section. -ad_proc -private install_input_widget { +ad_proc -private install_input_widget { {-type ""} {-size 40} {-extra_attributes ""} {-value ""} - param_name + param_name } { Return an HTML input widget for a parameter with an indication of whether the param is mandatory. } { - set type_attribute [ad_decode $type "" "" "type=\"$type\""] + set type_attribute [expr {$type eq "" ? "" : "type=\"$type\""}] if { $value ne "" } { append extra_attributes " value=\"[ns_quotehtml $value]\"" } - + set input_widget "" if { [install_param_mandatory_p $param_name] } { append input_widget " \[*\]" } return $input_widget -} +} ad_proc -private install_param_mandatory_p { param_name } { Return 1 if the given parameter with given name is @@ -99,36 +99,26 @@ array set mandatory_params_array $mandatory_params array set optional_params_array $optional_params - set form [ns_getform] set missing_params [list] - if { $form eq "" } { - # Form is empty - all mandatory params are missing - foreach param_name [array names mandatory_params_array] { - lappend missing_params $mandatory_params_array($param_name) - } - } else { - # Form is non-empty + # Loop over all params + set all_param_names [concat [array names mandatory_params_array] \ + [array names optional_params_array]] + foreach param_name $all_param_names { + set param_value [ns_queryget $param_name] + set mandatory_p [expr {$param_name in $mandatory_params}] - # Loop over all params - set all_param_names [concat [array names mandatory_params_array] \ - [array names optional_params_array]] - foreach param_name $all_param_names { - set param_value [ns_set iget $form $param_name] - set mandatory_p [expr {$param_name in $mandatory_params}] - - if { $param_value ne "" } { - # Param in form - set value in callers scope - uplevel [list set $param_name $param_value] + if { $param_value ne "" } { + # Param in form - set value in callers scope + uplevel [list set $param_name $param_value] + } else { + # Param not in form + if { $mandatory_p } { + # Mandatory param - complain + lappend missing_params $mandatory_params_array($param_name) } else { - # Param not in form - if { $mandatory_p } { - # Mandatory param - complain - lappend missing_params $mandatory_params_array($param_name) - } else { - # Optional param - set default - uplevel [list set $param_name $optional_params_array($param_name)] - } + # Optional param - set default + uplevel [list set $param_name $optional_params_array($param_name)] } } } @@ -321,7 +311,7 @@ } -proc install_back_button_widget {} { +proc install_back_button_widget {} { return [subst {Please try again. \n" - # Some APM procedures use util_memoize, so initialize the cache + # + # At this time, the basic data model and the proc + # "ad_acs_kernel_id" are defined, such we can also define the + # global variable for bootstrap, which is already needed for the + # out-of-band sourcing of 20-memoize-init.tcl below. + # + set ::acs::kernel_id [ad_acs_kernel_id] + + # Some APM procedures use util_memoize, so initialize the cache # before starting APM install array set errors {} apm_source [acs_package_root_dir acs-tcl]/tcl/20-memoize-init.tcl errors @@ -468,7 +466,7 @@ ns_write "

At least one core package has an unsatisfied dependency.\ No packages have been installed missing: [lindex $dependency_results 2]. \ Here's what the APM has computed:" - + ns_write "\n