Bugzilla – Attachment 145588 Details for
Bug 32306
Hold modifications don't log correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32306: Log after storing changes in ModReserve
Bug-32306-Log-after-storing-changes-in-ModReserve.patch (text/plain), 2.50 KB, created by
Emily Lamancusa (emlam)
on 2023-01-23 16:10:31 UTC
(
hide
)
Description:
Bug 32306: Log after storing changes in ModReserve
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2023-01-23 16:10:31 UTC
Size:
2.50 KB
patch
obsolete
>From f43e3b39183f4676d98285c354b5543ef8f608d7 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Thu, 24 Nov 2022 13:09:28 +0200 >Subject: [PATCH] Bug 32306: Log after storing changes in ModReserve > >When one modifies holds from records holds page, these >changes don't log into action_logs table correctly. >Instead holds data before modifications is stored to action_logs. > >This patch moves call for logaction after changes have >been stored in ModReserve. > >To test: >1. Find hold to modify. >2. If possible, locate this hold from action_logs table: >SELECT * FROM action_logs WHERE module = "HOLDS" AND object = <reserve_id>; >3. Modify hold, change its pickup library from A to B. >4. Save changes. >5. Take a look at action_logs table. >=> Modification is saved, but holds pickup library is still A. >6. Modify hold again, e.g add expiration date. >7. Save. >8. Find this new modification from action_logs. >=> In action_logs table expiration date is empty, but pickup library is now B. >9. Apply this patch. >10. Modify hold, change its pickup library back from B to A. >11. Save changes. >=> In action_logs table holds modification has now a correct pickup library A. > >Also prove t/db_dependent/Reserves.t. > >Sponsored-by: Koha-Suomi Oy >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > C4/Reserves.pm | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 6ff7149edc..a2b06405b2 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1119,16 +1119,12 @@ sub ModReserve { > $hold->cancel({ cancellation_reason => $cancellation_reason }); > } > elsif ($hold->found && $hold->priority eq '0' && $date) { >- logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold ) >- if C4::Context->preference('HoldsLog'); >- > # The only column that can be updated for a found hold is the expiration date > $hold->expirationdate($date)->store(); >- } >- elsif ($rank =~ /^\d+/ and $rank > 0) { > logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold ) > if C4::Context->preference('HoldsLog'); >- >+ } >+ elsif ($rank =~ /^\d+/ and $rank > 0) { > my $properties = { > priority => $rank, > branchcode => $branchcode, >@@ -1156,6 +1152,8 @@ sub ModReserve { > } > > _FixPriority({ reserve_id => $reserve_id, rank =>$rank }); >+ logaction( 'HOLDS', 'MODIFY', $hold->reserve_id, $hold ) >+ if C4::Context->preference('HoldsLog'); > } > } > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32306
:
144215
|
144216
|
145587
| 145588