This patch:
- makes the Koha::RecordProcessor code more clear
by removing the unnecessary newrecord variable.
- revises the filter to be more clear about the
expectation that operations are done directly on
the record parameter.
TEST PLAN
---------
prove t/RecordProcessor.t
prove t/db_dependent/Filter_MARC_ViewPolicy.t
run koha qa test tools
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. NO koha-qa errors
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
push @records, $precord;
}
- my @results;
foreach my $current_record (@records) {
- my $result = $current_record->clone();
+ my $result = $current_record;
my $interface = $self->{options}->{interface} // 'opac';
my $frameworkcode = $self->{options}->{frameworkcode} // q{};
my $hide = _should_hide_on_interface();
}
);
}
- push @results, $result;
- }
-
- if ( scalar @results == 1 ) {
- return $results[0];
- }
- else {
- return \@results;
}
+ return;
}
sub _filter_field {
return unless defined $record;
- my $newrecord = $record;
-
foreach my $filterobj (@{$self->filters}) {
next unless $filterobj;
- $newrecord = $filterobj->filter($newrecord);
+ $filterobj->filter($record);
}
- return $newrecord;
+ return $record;
}
sub DESTROY {