[Bug 13473] New: Plugins fail in 3.18
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Bug ID: 13473 Summary: Plugins fail in 3.18 Change sponsored?: --- Product: Koha Version: 3.18 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: bob-ewart@bobsown.com QA Contact: testopia@bugs.koha-community.org Created attachment 34465 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=34465&action=edit koha error log This was working in 3.16. I was able to enable plugins and upload the Kitchen-Sink plugin (see bug 13472 for the correct way to enable plugins.) When trying to execute or configure the plugin on 3.18 I got: Template process failed: file error - doc-head-open.inc: not found at /usr/share/koha/lib/C4/Templates.pm line 129. The koha error log is attached. It fails in 3.18 whether installed via command line (openSUSE 13.1) or apt-get (Debian 7). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Bob Ewart <bob-ewart@bobsown.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bob-ewart@bobsown.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Pete Edwards <koha@jsense.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@jsense.co.uk --- Comment #1 from Pete Edwards <koha@jsense.co.uk> --- I am getting the same issue - is there a workaround? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #2 from Pete Edwards <koha@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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #3 from Bob Ewart <bob-ewart@bobsown.com> --- That worked for me on installing KitchenSink. I have some other plugins that I will test. Thanks -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de, | |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@quecheelibrary.org -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |13639 CC| |z.tajoli@cineca.it -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #4 from Zeno Tajoli <z.tajoli@cineca.it> --- About this topic see also bug 13639 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #5 from Zeno Tajoli <z.tajoli@cineca.it> --- The bare minumum to create a patch (reading http://wiki.koha-community.org/wiki/Version_Control_Using_Git) 1)Install and setup git 2)git clone git://git.koha-community.org/koha.git kohaclone 3)'kohaclone' will be a new dir 4)cd kohaclone 5)Do your change with vi 6)git commit -a 7)git format-patch origin 8)Uplad the created file into bugzilla It is not the best workflow (git clone is quite long and dir kohaclone is around 1 Gb), but it is the easiest. To use git in better way you need to study it. Fro example from http://git-scm.com/documentation -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Bug 13473 depends on bug 13639, which changed state. Bug 13639 Summary: libclass-isa-perl should be a dependency http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13639 What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.18 |master --- Comment #6 from Nick Clemens <nick@quecheelibrary.org> --- I am seeing this on master as well -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #7 from Kyle M Hall <kyle@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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 35963 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35963&action=edit Bug 13473 - Plugins fail in 3.18 When trying to execute or configure the plugin on 3.18 I got: Template process failed: file error - doc-head-open.inc: not found at /usr/share/koha/lib/C4/Templates.pm line 129. Test Plan: 1) Install the Kitchen Sink plugin 2) Go to the configuration page of the plugin 3) Note the template processing error 4) Apply this patch 5) Refresh the page 6) Note the page now loads -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |critical -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35963|0 |1 is obsolete| | --- Comment #9 from Nick Clemens <nick@quecheelibrary.org> --- Created attachment 35965 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35965&action=edit [SIGNED OFF] Bug 13473 - Plugins fail When trying to execute or configure the plugin on 3.18 I got: Template process failed: file error - doc-head-open.inc: not found at /usr/share/koha/lib/C4/Templates.pm line 129. Test Plan: 1) Install the Kitchen Sink plugin 2) Go to the configuration page of the plugin 3) Note the template processing error 4) Apply this patch 5) Refresh the page 6) Note the page now loads Signed-off-by: Nick <nick@quecheelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Nick Clemens <nick@quecheelibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Plugins fail in 3.18 |Plugins fail when loading | |templates -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35965|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 36120 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=36120&action=edit Bug 13473 - Plugins fail When trying to execute or configure the plugin on 3.18 I got: Template process failed: file error - doc-head-open.inc: not found at /usr/share/koha/lib/C4/Templates.pm line 129. Test Plan: 1) Install the Kitchen Sink plugin 2) Go to the configuration page of the plugin 3) Note the template processing error 4) Apply this patch 5) Refresh the page 6) Note the page now loads Signed-off-by: Nick <nick@quecheelibrary.org> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Kyle! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chris@bigballofwax.co.nz Status|Pushed to Master |Pushed to Stable --- Comment #12 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.18.x will be in 3.18.5 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Héctor <hectorejch@yahoo.com.ar> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hectorejch@yahoo.com.ar -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 Héctor <hectorejch@yahoo.com.ar> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hectorejch@yahoo.com.ar -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #13 from Héctor <hectorejch@yahoo.com.ar> --- This works, but the system language is shown only in English, although it is set to Spanish -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Héctor from comment #13)
This works, but the system language is shown only in English, although it is set to Spanish
Could you please fill a new bug for that? Put this one in the 'see also'. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #15 from Héctor <hectorejch@yahoo.com.ar> --- (In reply to Tomás Cohen Arazi from comment #14)
(In reply to Héctor from comment #13)
This works, but the system language is shown only in English, although it is set to Spanish
Could you please fill a new bug for that? Put this one in the 'see also'.
But the error occurs when you apply this patch. I "solved" this by replacing: #Otherwise return theme/'en', last resort fallback/'en' for my $theme (@themes) { if ( -e "$htdocs/$theme/en/$where/$tmpl" ) { return ( $theme, 'en', uniq( \@themes ) ); } } by # Otherwise return theme/'en', last resort fallback/'en' for my $theme (@themes) { if ( -e "$htdocs/$theme/es-ES/$where/$tmpl" ) { return ( $theme, 'es-ES', uniq( \@themes ) ); } } -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13473 --- Comment #16 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Héctor from comment #15)
(In reply to Tomás Cohen Arazi from comment #14)
(In reply to Héctor from comment #13)
This works, but the system language is shown only in English, although it is set to Spanish
Could you please fill a new bug for that? Put this one in the 'see also'.
But the error occurs when you apply this patch.
I "solved" this by replacing:
#Otherwise return theme/'en', last resort fallback/'en' for my $theme (@themes) { if ( -e "$htdocs/$theme/en/$where/$tmpl" ) { return ( $theme, 'en', uniq( \@themes ) ); } }
by
# Otherwise return theme/'en', last resort fallback/'en' for my $theme (@themes) { if ( -e "$htdocs/$theme/es-ES/$where/$tmpl" ) { return ( $theme, 'es-ES', uniq( \@themes ) ); } }
That part of the code deals with the fallback language, in the situation the required file doesn't exist in the requested language. So it is ok for that to fallback to english. Please fill a new bug if you think/see that the plugins don't respect the selected language. And please specify the steps to reproduce it. On a new bug report. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org