Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.332.2.71 -r1.332.2.72 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 5 Feb 2021 14:19:52 -0000 1.332.2.71 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 6 Feb 2021 09:37:27 -0000 1.332.2.72 @@ -1459,8 +1459,18 @@ # "working". # set name [:normalize_path $name] - foreach package_key [list [:package_key] xowiki] { + # + # Try to locate the file first in the actual package, and - if not + # found - as well in "xowiki". + # + set package_keys ${:package_key} + if {${:package_key} ne "xowiki"} { + lappend package_keys xowiki + } + + set paths {} + foreach package_key $package_keys { # # Backward compatibility check for old style definitions. # Notify user about such deprecated usages. @@ -1469,6 +1479,7 @@ set tmpl /packages/$package_key/$location/$name set fn [acs_root_dir]/$tmpl + lappend paths $fn #ns_log notice "=== check get_adp_template $fn" if {[ad_file readable $fn.adp]} { @@ -1484,6 +1495,8 @@ } } } + ns_log warning "get_adp_template: could not locate template '$name'" \ + "on the following paths:\n[join $paths \n]" return "" } Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.368.2.84 -r1.368.2.85 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 1 Feb 2021 10:41:29 -0000 1.368.2.84 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 6 Feb 2021 09:37:27 -0000 1.368.2.85 @@ -1994,7 +1994,7 @@ # # Refetch "template_file", since it might have been changed via - # set-parameter the cache flush (next line) is not pretty here + # set-parameter. The cache-flush (next line) is not pretty here # and should be supported from xotcl-core. # ::xo::cc unset -nocomplain cache([list $context_package_id get_parameter template_file]) @@ -2005,15 +2005,21 @@ # standard location. # if {[string range $template_file 0 0] eq "/"} { - ns_log warning "ignore template file on non-standard location: $template_file" + ns_log warning "ignore template as specified in parameter 'template_file'" \ + "on non-standard location: $template_file. The template should be" \ + " under\n/packages/[${:package_id} package_key]/resources/templates/..." set template_file [::$context_package_id get_parameter \ -check_query_parameter false \ -nocache \ template_file view-default] } - set template_file [::${:package_id} get_adp_template $template_file] + set validated_template_file [::${:package_id} get_adp_template $template_file] + if {$validated_template_file eq ""} { + ns_log error "invalid template specified in parameter 'template_file': '$template_file'" + } + set template_file $validated_template_file - # Force xowiki css to be loaded first(ish), so we can override + # Force xowiki*.css to be loaded first(ish), so we can override # its styling via the theme (e.g. different buttons...). This # uses the "template::head" API directly, since resources from # requireCSS are typically loaded later than those from the theme.