Bug 16907: Make sure the log will be written only if the patron has been deleted

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-08-09 10:17:18 +01:00 committed by Kyle M Hall
parent c4a923bdf7
commit b9af2e9731
1 changed files with 2 additions and 1 deletions

View File

@ -83,8 +83,9 @@ sub delete {
# FIXME Could be $patron->get_lists
$_->delete for Koha::Virtualshelves->search( { owner => $self->borrowernumber } );
logaction( "MEMBERS", "DELETE", $self->borrowernumber, "" ) if C4::Context->preference("BorrowersLog");
$deleted = $self->SUPER::delete;
logaction( "MEMBERS", "DELETE", $self->borrowernumber, "" ) if C4::Context->preference("BorrowersLog");
}
);
return $deleted;