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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jan 15 16:10:19 CET 2015


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

--- Comment #2 from Pete Edwards <koha at jsense.co.uk> ---
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