From 3cfdf3dbf17b7208967efc5f370b26862f9a0226 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 7 Dec 2016 03:21:43 +0000 Subject: [PATCH] [SIGNED-OFF] 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 --- Koha/Patron.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index a40d6f0..11f80bd 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