From dffa5d9ba8d16ee10794617dacb3c985c690775b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 31 Oct 2019 10:11:07 +0000 Subject: [PATCH] Bug 22706: (RM follow-up) Remove use of Koha::Plugins::Handler Using both Koha::Plugins and Koha::Plugins::Handler inside the same class causes issues for runtime module loading which in turn caused all the plugins tests to fail. This patch converts this patchset to use the direct call style used elsewhere in Koha removing the need for Koha::Plugins::Handler. Signed-off-by: Martin Renvoize --- Koha/Patron.pm | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 92580725db..2b079af390 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -44,7 +44,6 @@ use Koha::Patron::Images; use Koha::Patron::Relationships; use Koha::Patrons; use Koha::Plugins; -use Koha::Plugins::Handler; use Koha::Subscription::Routinglists; use Koha::Token; use Koha::Virtualshelves; @@ -237,14 +236,12 @@ sub store { # This plugin hook will also be used by a plugin for the Norwegian national # patron database. This is why we need to pass both the password and the # borrowernumber to the plugin. - my $ret = Koha::Plugins::Handler->run({ - class => ref $plugin, - method => 'check_password', - params => { + my $ret = $plugin->check_password( + { password => $self->plain_text_password, - borrowernumber => $self->borrowernumber, - }, - }); + borrowernumber => $self->borrowernumber + } + ); if ( $ret->{'error'} == 1 ) { Koha::Exceptions::Password::Plugin->throw(); } @@ -754,14 +751,12 @@ sub set_password { # This plugin hook will also be used by a plugin for the Norwegian national # patron database. This is why we need to pass both the password and the # borrowernumber to the plugin. - my $ret = Koha::Plugins::Handler->run({ - class => ref $plugin, - method => 'check_password', - params => { + my $ret = $plugin->check_password( + { password => $password, - borrowernumber => $self->borrowernumber, - }, - }); + borrowernumber => $self->borrowernumber + } + ); # This plugin hook will also be used by a plugin for the Norwegian national # patron database. This is why we need to call the actual plugins and then # check skip_validation afterwards. -- 2.20.1