@@ -, +, @@ Steps to reproduce: - Create a patron - Add holds for patron - Holds are recorded to "reserves" table - Delete patron - Confirm delete - Apply this patch - Create a patron - Add holds for patron - Holds are recorded to "reserves" table - Delete patron - Alert text of holds is displayed - Confirm patron delete --- Koha/Hold.pm | 2 +- Koha/Patron.pm | 7 +++++-- .../intranet-tmpl/prog/en/modules/members/deletemem.tt | 3 +++ members/deletemem.pl | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -354,7 +354,7 @@ sub cancel { my ( $self, $params ) = @_; $self->_result->result_source->schema->txn_do( sub { - $self->cancellationdate(dt_from_string); + $self->cancellationdate( dt_from_string->strftime( '%Y-%m-%d %H:%M:%S' ) ); $self->priority(0); $self->_move_to_old; $self->SUPER::delete(); # Do not add a DELETE log --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -324,8 +324,11 @@ sub delete { my $deleted; $self->_result->result_source->schema->txn_do( sub { - # Delete Patron's holds - $self->holds->delete; + # Cancel Patron's holds + my $holds = $self->holds; + while( my $hold = $holds->next ){ + $hold->cancel; + } # Delete all lists and all shares of this borrower # Consistent with the approach Koha uses on deleting individual lists --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/deletemem.tt @@ -37,6 +37,9 @@ [% ELSIF op == 'delete_confirm' and patron %] [%# TODO add "patron does not exist" unless patron %]