From 14c702bee5362654c8779b8b4a33a0d679ee6a6e Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 29 Mar 2018 07:11:40 -0400 Subject: [PATCH] Bug 20181: (QA follow-up) Remove double check Signed-off-by: Jonathan Druart --- Koha/Template/Plugin/KohaPlugins.pm | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Koha/Template/Plugin/KohaPlugins.pm b/Koha/Template/Plugin/KohaPlugins.pm index a6822ca691..0148c7f301 100644 --- a/Koha/Template/Plugin/KohaPlugins.pm +++ b/Koha/Template/Plugin/KohaPlugins.pm @@ -48,10 +48,13 @@ to output to the head section of opac pages. sub get_plugins_opac_head { return q{} - unless C4::Context->preference('UseKohaPlugins') - && C4::Context->config("enable_plugins"); + unless C4::Context->preference('UseKohaPlugins'); - my @plugins = Koha::Plugins->new()->GetPlugins( + my $p = Koha::Plugins->new(); + + return q{} unless $p; + + my @plugins = $p->GetPlugins( { method => 'opac_head', } @@ -73,10 +76,13 @@ to output to the javascript section of at the bottom of opac pages. sub get_plugins_opac_js { return q{} - unless C4::Context->preference('UseKohaPlugins') - && C4::Context->config("enable_plugins"); + unless C4::Context->preference('UseKohaPlugins'); + + my $p = Koha::Plugins->new(); + + return q{} unless $p; - my @plugins = Koha::Plugins->new()->GetPlugins( + my @plugins = $p->GetPlugins( { method => 'opac_js', } -- 2.39.5