Bug 33284: Set renewer_id appropriately for anonymize settings

This patch adds a trigger into the anonymize function of
Koha::Old::Checkout 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>
This commit is contained in:
Martin Renvoize 2023-03-21 14:08:05 +00:00 committed by Katrin Fischer
parent d82abae1da
commit e6d0df1156
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 3 additions and 0 deletions

View File

@ -136,6 +136,9 @@ sub anonymize {
Koha::Exceptions::SysPref::NotSet->throw( syspref => 'AnonymousPatron' )
unless $anonymous_id;
my $self_renewals = $self->renewals->search( { renewer_id => $self->borrowernumber } );
$self_renewals->update( { renewer_id => $anonymous_id } );
return $self->update( { borrowernumber => $anonymous_id } );
}