https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15870

--- Comment #8 from M. Tompsett <mtomp...@hotmail.com> ---
(In reply to Tomás Cohen Arazi from comment #6)
> Mark: you need to get rid of the clone. The RecordProcessor pipeline is
> designed so it works on the original object.

I'm torn on that.

%%%% SNIP %%%%
sub process {
    my $self = shift;
    my $record = shift || $self->record;

    return unless defined $record;

    my $newrecord = $record;

    foreach my $filterobj (@{$self->filters}) {
        next unless $filterobj;
        $newrecord = $filterobj->filter($newrecord);
    }

    return $newrecord;
}
%%%% SNIP %%%%

The clincher for me is that the $filterobj->filter call returns something. What
is the point of returning something if we are modifying the original object?
The return $newrecord is still necessary because of pre-call binding or passing
the record(s) directly. However, the "$newrecord =" makes no sense if the
original was not intended to stay intact, because it would have already been
modified!

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to