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.24 -r1.25 --- openacs-4/packages/acs-bootstrap-installer/installer.tcl 11 Aug 2013 22:56:46 -0000 1.24 +++ openacs-4/packages/acs-bootstrap-installer/installer.tcl 27 Oct 2014 16:39:04 -0000 1.25 @@ -45,15 +45,15 @@ } { array set mandatory_params_array [install_mandatory_params] set mandatory_names [array names mandatory_params_array] - return [expr {[lsearch -exact $mandatory_names $param_name] != -1}] + return [expr {$param_name in $mandatory_names}] } ad_proc -private install_mandatory_params {} { Return information about parameters that are mandatory for OpenACS installation. @return An array list with variable names as values - and pretty names as keys. + and pretty names as keys. } { return { email "Email" @@ -72,7 +72,7 @@ for OpenACS installation. @return An array list with variable names as values - and default values as keys. + and default values as keys. } { return { username "" @@ -90,9 +90,9 @@ more primitive proc instead. @param mandatory_params An array list where keys are param names and values - are pretty names. + are pretty names. @param optional_params An array list with param names as keys and default - values as keys. + values as keys. @author Peter Marklund } { @@ -115,7 +115,7 @@ [array names optional_params_array]] foreach param_name $all_param_names { set param_value [ns_set iget $form $param_name] - set mandatory_p [expr {[lsearch -exact $mandatory_params $param_name] != -1}] + set mandatory_p [expr {$param_name in $mandatory_params}] if { $param_value ne "" } { # Param in form - set value in callers scope @@ -136,7 +136,7 @@ # If there are missing mandatory params - return a complaint # page and exit if { [llength $missing_params] > 0 } { - ns_write "[install_header 200 "Missing parameters"] + ns_write "[install_header 200 {Missing parameters}] The following mandatory parameters are missing:
$script
, doesn't exist. Please check
your URL and try again.
"
}
+
+ array set errors {}
+
# Engage a mutex for double-click protection.
ns_mutex lock [nsv_get acs_installer mutex]
if { [catch {
- # Source the page and then unlock the mutex.
- apm_source $path
- ns_mutex unlock [nsv_get acs_installer mutex]
+ # Source the page and then unlock the mutex.
+ apm_source $path errors
+ ns_mutex unlock [nsv_get acs_installer mutex]
} error] } {
- # In case of an error, don't forget to unlock the mutex.
- ns_mutex unlock [nsv_get acs_installer mutex]
- global errorInfo
- install_return 500 "Error" "The following error occurred in an installation script:
-
--" - + # In case of an error, don't forget to unlock the mutex. + ns_mutex unlock [nsv_get acs_installer mutex] + global errorInfo + install_return 500 "Error" "The following error occurred in an installation script:\n\ +[ns_quotehtml $errorInfo]
\n" } + if {[array size errors] > 0} { + install_return 500 "Error" [install_load_errors_formatted errors] + } return "filter_return" } proc install_admin_widget {} { return " -[ns_quotehtml $errorInfo]