From 2a43195322c228795b08ebbc165e360c725c2b56 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 4 Feb 2016 17:42:42 +0100 Subject: [PATCH] Bug 15743: Allow plugins to embed Perl modules This patch allows plugins to embed Perl modules by ignoring Perl modules in plugins directory that don't inherit from Koha::Plugins::Base TEST PLAN --------- 1) Edit koha-conf.xml to have enable_plugins set to 1, and the pluginsdir set to a particular path. 2) Create a dummy plugin file. (e.g. {that path}/Koha/Plugin/Kaboom.pm) Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- Koha/Plugins.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm index 9e2d4eb609..d9055548c8 100644 --- a/Koha/Plugins.pm +++ b/Koha/Plugins.pm @@ -63,6 +63,8 @@ sub GetPlugins { foreach my $plugin_class (@plugin_classes) { if ( can_load( modules => { $plugin_class => undef } ) ) { + next unless $plugin_class->isa('Koha::Plugins::Base'); + my $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} }); if ($method) { -- 2.39.5