From 46c99f47ca68597575abf5ca951a33284d29e69f Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 21 Mar 2013 01:35:16 -0700 Subject: [PATCH 1/3] Bug 9883 - Koha::Plugins::Base should not require koha-conf to load Test Plan: 1) Run t/db_dependent/Plugins.t 2) Apply patch 3) Re-run t/db_dependent/Plugins.t Signed-off-by: Magnus Enger The tests pass both before and after the patch. I can see no ill effects on the functionality (tried uploading and accessing the Kitchen Sink plugin). Signed-off-by: Katrin Fischer After installing libmodule-bundled-files-perl from the debian.koha-community.org I ran through Makefile.PL updating my conf file successfully. Also all tests and QA script pass now. Signed-off-by: Katrin Fischer Signed-off-by: Jared Camins-Esakov --- Koha/Plugins/Base.pm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index 3b0ab15747..b4091b7b27 100644 --- a/Koha/Plugins/Base.pm +++ b/Koha/Plugins/Base.pm @@ -26,10 +26,6 @@ use base qw{Module::Bundled::Files}; use C4::Context; use C4::Auth; -BEGIN { - push @INC, C4::Context->config("pluginsdir"); -} - =head1 NAME C4::Plugins::Base - Base Module for plugins From 673a034e5ca5bc544d403d9d5f358db7f30c0e5d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 22 Mar 2013 02:08:02 -0700 Subject: [PATCH 2/3] Bug 9883 - Add missing parameter to koha-conf.xml causing Plugins.t to fail Signed-off-by: Katrin Fischer Signed-off-by: Jared Camins-Esakov --- etc/koha-conf.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/koha-conf.xml b/etc/koha-conf.xml index 73d67bf7eb..22529ac5cd 100644 --- a/etc/koha-conf.xml +++ b/etc/koha-conf.xml @@ -277,6 +277,7 @@ __PAZPAR2_TOGGLE_XML_POST__ authorities 1 __PLUGINS_DIR__ + 0 __INTRANET_CGI_DIR__ __OPAC_CGI_DIR__/opac __OPAC_TMPL_DIR__ From eedbd387abd946c96075dc002d598e56eb7806de Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 22 Mar 2013 04:40:36 -0700 Subject: [PATCH 3/3] Bug 9883 - Koha::Plugins::* should not require koha-conf to load - Followup - Load C4::Auth at run time Signed-off-by: Katrin Fischer Unset KOHA_CONF variable and made sure t/00_load.t passed Also ran Makefile.PL doing an update on my existing installation and checked koha-conf.xml: /home/katrin/koha-dev/var/lib/plugins 0 Signed-off-by: Jared Camins-Esakov --- Koha/Plugins/Base.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Plugins/Base.pm b/Koha/Plugins/Base.pm index b4091b7b27..3a8dc6384a 100644 --- a/Koha/Plugins/Base.pm +++ b/Koha/Plugins/Base.pm @@ -24,7 +24,6 @@ use Module::Pluggable require => 1; use base qw{Module::Bundled::Files}; use C4::Context; -use C4::Auth; =head1 NAME @@ -104,6 +103,8 @@ C4:Template, but at the moment, it does not. sub get_template { my ( $self, $args ) = @_; + require C4::Auth; + my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => $self->mbf_path( $args->{'file'} ), query => $self->{'cgi'},