[Koha-bugs] [Bug 13473] Plugins fail in 3.18

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Feb 17 12:25:48 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473

--- Comment #7 from Kyle M Hall <kyle at bywatersolutions.com> ---
Excellent work! I was able to create a patch based on your fix here!

(In reply to Pete Edwards from comment #2)
> I'm not familiar enough with Koha to offer a patch but here is a workaround
> that is OK for me.
> 
> I had to modify C4::Templates::themelanguage(). For normal pages this is
> fine but plugin templates have an absolute path (in $tmpl) so the code to
> check for a template in the correct language completely fails:
>     for my $theme (@themes) {
>         if ( -e "$htdocs/$theme/$lang/$where/$tmpl" ) {
>             return ( $theme, $lang, uniq( \@themes ) );
>         }
>     }
> Instead, we drop through both loops and come out of the function without any
> return. This seems pretty bad practice. At the end of the function I added:
>     if ($tmpl =~ /^\//) {
>         return ( $themes[0], $lang, uniq( \@themes ) );
>     }
> This probably doesn't fix every possible situation, nor do I know about
> themes but it might help whoever does try and fix the problem.
> 
> As an aside, it would be better to run uniq on the themes array before
> checking for files existing so it reduces the number of times it may try the
> wrong location.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list