From 05f18896f71e0dc0d23a82a4f1a4e1d08cad36da Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 21 Mar 2023 14:08:05 +0000 Subject: [PATCH] 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 Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer (cherry picked from commit e6d0df11567757052d175f949ff3a953d69439eb) Signed-off-by: Fridolin Somers --- Koha/Old/Checkout.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Koha/Old/Checkout.pm b/Koha/Old/Checkout.pm index abd19d8bb6..570a8c77ee 100644 --- a/Koha/Old/Checkout.pm +++ b/Koha/Old/Checkout.pm @@ -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 } ); }