From 46dc55aa4d58c1cfc7d367d7c4e0379a50a774d6 Mon Sep 17 00:00:00 2001 From: Andrew Fuerste Henry Date: Mon, 25 Nov 2024 20:31:30 +0000 Subject: [PATCH] Bug 38531: add diff when reverting hold Content-Type: text/plain; charset=utf-8 To test: 1 - place, capture, and revert a hold 2 - view action logs for your hold via SQL so you can see the diff column 3 - confirm reversion of waiting hold generates a MODIFY line in logs with no diff 4 - apply patch, restart_all 5 - capture and revert your hold again 6 - confirm logs include diff showing change to found and priority Signed-off-by: Sam Sowanick Signed-off-by: Marcel de Rooy --- C4/Reserves.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 046bfd0235..a4cfc7cb50 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -2067,6 +2067,8 @@ sub RevertWaitingStatus { } )->next; + my $original = C4::Context->preference('HoldsLog') ? $hold->unblessed : undef; + ## Increment the priority of all other non-waiting ## reserves for this bib record my $holds = Koha::Holds->search({ biblionumber => $hold->biblionumber, priority => { '>' => 0 } }) @@ -2083,7 +2085,7 @@ sub RevertWaitingStatus { } )->store( { hold_reverted => 1 } ); - logaction( 'HOLDS', 'MODIFY', $hold->id, $hold ) + logaction( 'HOLDS', 'MODIFY', $hold->id, $hold, undef, $original ) if C4::Context->preference('HoldsLog'); _FixPriority( { biblionumber => $hold->biblionumber } ); -- 2.39.5