From 1c3b3f21286d40abc7fc5795f793ddee0ca85525 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=UTF-8 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 --- Koha/RecordProcessor.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Koha/RecordProcessor.pm b/Koha/RecordProcessor.pm index cbbd726..b9d2918 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; } } -- 1.7.10.4