Bug 33284: Set renewer_id for sets of checkouts
This patch adds a trigger into the anonymize function of
Koha::Old::Checkouts such that we pass along the anonymize action to
the renewals record.
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4f77ec8387)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
05f18896f7
commit
bf1680c913
|
|
@ -101,6 +101,11 @@ sub anonymize {
|
|||
Koha::Exceptions::SysPref::NotSet->throw( syspref => 'AnonymousPatron' )
|
||||
unless $anonymous_id;
|
||||
|
||||
while ( my $checkout = $self->next ) {
|
||||
my $self_renewals = $checkout->renewals->search( { renewer_id => $checkout->borrowernumber } );
|
||||
$self_renewals->update( { renewer_id => $anonymous_id } );
|
||||
}
|
||||
|
||||
return $self->update( { borrowernumber => $anonymous_id }, { no_triggers => 1 } );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue