Bug 14642: Make sure the log will be written only if the hold has been deleted
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 9 Aug 2016 09:14:44 +0000 (10:14 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 17 Aug 2016 18:43:13 +0000 (18:43 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Hold.pm

index 3cc8440..ba75a52 100644 (file)
@@ -99,10 +99,12 @@ $hold->delete();
 sub delete {
     my ( $self ) = @_;
 
+    my $deleted = $self->SUPER::delete($self);
+
     logaction( 'HOLDS', 'DELETE', $self->reserve_id, Dumper($self->unblessed) )
         if C4::Context->preference('HoldsLog');
 
-    return $self->SUPER::delete($self);
+    return $deleted;
 }
 
 =head3 waiting_expires_on