From 8b96cfb0de916a57a13ad1aecb1dcdfe2d159018 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 2 Feb 2017 12:05:05 -0500 Subject: [PATCH] Proof that all 4 cases are triggered. https://bugs.koha-community.org/show_bug.cgi?id=18036 --- C4/Templates.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C4/Templates.pm b/C4/Templates.pm index 10d0283..3415da1 100644 --- a/C4/Templates.pm +++ b/C4/Templates.pm @@ -256,19 +256,23 @@ sub themelanguage { my $where = $tmpl =~ /xsl$/ ? 'xslt' : 'modules'; for my $theme (@themes) { if ( -e "$htdocs/$theme/$lang/$where/$tmpl" ) { +print STDERR "CASE 1"; return ( $theme, $lang, [ uniq(@themes) ] ); } } # Otherwise return theme/'en', last resort fallback/'en' for my $theme (@themes) { if ( -e "$htdocs/$theme/en/$where/$tmpl" ) { +print STDERR "CASE 2"; return ( $theme, 'en', [ uniq(@themes) ] ); } } # tmpl is a full path, so this is a template for a plugin if ( $tmpl =~ /^\// && -e $tmpl ) { +print STDERR "CASE 3"; return ( $themes[0], $lang, [ uniq(@themes) ] ); } +print STDERR "CASE 4"; } -- 2.1.4