From 767a33a91eb58a1ec68bdfb6c159dd5d59e39209 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 7 Dec 2016 03:21:43 +0000 Subject: [PATCH] Bug 17741: Use Koha::Patron->holds when deleting a patron There is a TODO in Koha::Patron->delete, this method should call the Koha::Patron->holds to retrieve the holds made by the patron we are removing instead of calling Koha::Holds->search Test plan: prove t/db_dependent/Koha/Patrons.t Should return green Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- Koha/Patron.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index ffdd7e3c23..3790884c97 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -66,8 +66,7 @@ sub delete { $self->_result->result_source->schema->txn_do( sub { # Delete Patron's holds - # FIXME Should be $patron->get_holds - $_->delete for Koha::Holds->search( { borrowernumber => $self->borrowernumber } ); + $self->holds->delete; # Delete all lists and all shares of this borrower # Consistent with the approach Koha uses on deleting individual lists -- 2.39.5