From 0195a2af99d9e7cd15e39e5cb08d9be4b0ea1759 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Thu, 11 Feb 2016 23:30:36 -0500 Subject: [PATCH] Bug 15777 - Refactor and fix the RecordProcessor class MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit TEST PLAN --------- 1) Apply all three patches 2) prove -v t/RecordProcessor.t -- all should be successful 3) run koha qa test tools Signed-off-by: Marc Véron Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- Koha/RecordProcessor.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Koha/RecordProcessor.pm b/Koha/RecordProcessor.pm index cbbd7262f2..b9d2918021 100644 --- a/Koha/RecordProcessor.pm +++ b/Koha/RecordProcessor.pm @@ -103,13 +103,14 @@ sub new { : $param->{filters}; my @filters = ( ); - foreach my $filter (@{ $req_filters }) { - next unless $filter; - my $filter_module = $filter =~ m/:/ ? $filter : "Koha::Filter::${schema}::${filter}"; + foreach my $filter_name (@{ $req_filters }) { + next unless $filter_name; + # Fully qualify the module name. + my $filter_module = $filter_name =~ m/:/ ? $filter_name : "Koha::Filter::${schema}::${filter_name}"; if (can_load( modules => { $filter_module => undef } )) { - my $object = $filter_module->new(); - $filter_module->initialize($param); - push @filters, $object; + my $filter = $filter_module->new(); + $filter->initialize($param); + push @filters, $filter; } } -- 2.39.5