From f2a4072d06c2ab6481cdba2f241e6b19afa4570a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 24 Jan 2020 10:16:30 +0100 Subject: [PATCH] Bug 23237: Fix PLUGIN_DIR parameter in master/19.11 Method get_plugin_dir() is not correct when plugin_dirs parameter is repeated in koha-conf.xml. A new method bundle_path() must be used instead. bundle_dir() is available in 19.11 and after. So the new patch must not be backported to 19.05 and 18.11. As it is the usage of the new template parameter PLUGIN_DIR will be OK in 18.11 and 19.05 as soon as plugins_dir parameter is unique in koha-conf.xml. Thanks Thomas --- Koha/Plugins/Base.pm | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index 6a723c0..cf2f8ea 100644 --- a/Koha/Plugins/Base.pm +++ b/Koha/Plugins/Base.pm @@ -168,7 +168,7 @@ sub get_template { CLASS => $self->{'class'}, METHOD => scalar $self->{'cgi'}->param('method'), PLUGIN_PATH => $self->get_plugin_http_path(), - PLUGIN_DIR => $self->get_plugin_dir(), + PLUGIN_DIR => $self->bundle_path(), ); return $template; @@ -215,22 +215,6 @@ sub get_plugin_http_path { return "/plugin/" . join( '/', split( '::', $self->{'class'} ) ); } -=head2 get_plugin_dir - -To [% INCLUDE %] another TT template from a template, an absolute path to the -template is required. This method returns that absolute file system path. - -usage: my $path = $self->get_plugin_dir(); - -=cut - -sub get_plugin_dir { - my ($self) = @_; - - my $base = C4::Context->config('pluginsdir'); - return "$base/" . join( '/', split( '::', $self->{'class'} ) ); -} - =head2 go_home go_home is a quick redirect to the Koha plugins home page -- 2.7.4