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 } ); }