Bug 24547: Add more action logs for holds
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 30 Jan 2020 15:29:05 +0000 (10:29 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 14 Apr 2020 15:16:18 +0000 (16:16 +0100)
It seems like ModReserveFill and ModReserveAffect should both produce action logs for holds.

Test Plan:
1) Apply this patch
2) Place a hold
3) Check in the item to trap the hold
4) Check out the item to fill the hold
5) Check the action logs for that reserve id
6) Note the new logs!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Reserves.pm

index 08b1689..b4cc6c4 100644 (file)
@@ -1049,6 +1049,9 @@ sub ModReserveFill {
         }
     );
 
+    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
+        if C4::Context->preference('HoldsLog');
+
     # FIXME Must call Koha::Hold->cancel ? => No, should call ->filled and add the correct log
     Koha::Old::Hold->new( $hold->unblessed() )->store();
 
@@ -1149,6 +1152,9 @@ sub ModReserveAffect {
       CartToShelf( $itemnumber );
     }
 
+    logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, Dumper($hold->unblessed) )
+        if C4::Context->preference('HoldsLog');
+
     return;
 }