From d57943505993b0708f1e7d50c5a18e6e9cb996c1 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 Content-Type: text/plain; charset=utf-8 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 --- Koha/Patron.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index ffdd7e3..3790884 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.1.4