Index: openacs-4/packages/acs-admin/www/apm/version-reload.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-reload.tcl,v
diff -u -r1.9.20.3 -r1.9.20.4
--- openacs-4/packages/acs-admin/www/apm/version-reload.tcl 5 Aug 2014 10:08:55 -0000 1.9.20.3
+++ openacs-4/packages/acs-admin/www/apm/version-reload.tcl 7 Aug 2014 19:09:26 -0000 1.9.20.4
@@ -27,7 +27,19 @@
if { [llength $files] == 0 } {
append body "There are no changed files to reload in this package.
"
} else {
- append body "Marked the following file[ad_decode [llength $files] 1 "" "s"] for reloading:
\n"
+ append body "Marked the following file[ad_decode [llength $files] 1 "" "s"] for reloading:\n"
+
+ # Source all of the marked files using the current interpreter, accumulating
+ # errors into apm_package_load_errors
+ array set errors [list]
+ catch { apm_load_any_changed_libraries errors }
+
+ if {[info exists errors($package_key)]} {
+ array set package_errors $errors($package_key)
+ } else {
+ array set package_errors [list]
+ }
+
foreach file $files {
append body "- $file"
if { [nsv_exists apm_reload_watch $file] } {
@@ -44,9 +56,30 @@
}]
lappend files_to_watch $local_path
}
- append body "\n"
+
+ if {[info exists package_errors($file)]} {
+ append body "
- ERROR!
" \
+ "[ad_quotehtml $package_errors($file)]
"
+ }
+ append body " \n"
+ }
+ append body "
\n"
+
+ set n_errors [array size package_errors]
+ if {$n_errors > 0} {
+ if {$n_errors > 1} {
+ set exist_n_error_files "were $n_errors files"
+ } else {
+ set exist_n_error_files "was $n_errors file"
+ }
+ append body "
+ There
+ $exist_n_error_files with errors that prevented complete
+ reloading. Fix the problem, then reload the
+ package again to finish the reload.
+
+ "
}
- append body "
\n"
}
@@ -68,4 +101,6 @@
}]
-ad_return_template apm
+# template::head::add_javascript -src "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
+
+ad_return_template