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 <josef.moravec@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
81585647ef
commit
767a33a91e
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue