From dd2ba3c1e63fd7ca49099922ebcec51c39a2731e Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 18 Feb 2026 22:15:32 +0000 Subject: [PATCH] Bug 41883: logaction when batch modifying holds To test: -APPLY PATCH and restart_all -Place a hold -Run the Holds log using the hold's reserve_id. There will be a single entry for the hold's creation. -Find the hold using the batch hold modification tool, and update its pickup location -Look at the action log, the chnage should be logged -Try batch modding holds in other ways, ensure the changes are logged -Turn off HoldsLog and batch modify some holds, the changes should NOT be logged. --- tools/batch_modify_holds.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/batch_modify_holds.pl b/tools/batch_modify_holds.pl index 4ba25f9cf40..eddfbcb02d5 100755 --- a/tools/batch_modify_holds.pl +++ b/tools/batch_modify_holds.pl @@ -25,6 +25,7 @@ use JSON qw( to_json ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); +use C4::Log qw( logaction ); use Koha::DateUtils qw( dt_from_string ); use Koha::Holds; @@ -65,6 +66,7 @@ if ( $op eq 'cud-form' ) { Koha::Holds->search( { reserve_id => { -in => \@hold_ids } }, { join => [ "item", "biblio" ] } ); while ( my $hold = $holds_to_update->next ) { + my $hold_before_mod = $hold->unblessed; if ($new_expiration_date) { $hold->expirationdate($new_expiration_date)->store; @@ -98,6 +100,10 @@ if ( $op eq 'cud-form' ) { if ($clear_hold_notes) { $hold->reservenotes(undef)->store; } + + logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold, undef, $hold_before_mod ) + if C4::Context->preference('HoldsLog'); + push @holds_data, $hold; } -- 2.39.5