Bugzilla – Attachment 125898 Details for
Bug 29192
DefaultHoldExpirationDate sends a DateTime object to logs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29192: Discard changes before logging a newly created hold
Bug-29192-Discard-changes-before-logging-a-newly-c.patch (text/plain), 1.46 KB, created by
Nick Clemens (kidclamp)
on 2021-10-07 15:57:12 UTC
(
hide
)
Description:
Bug 29192: Discard changes before logging a newly created hold
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-10-07 15:57:12 UTC
Size:
1.46 KB
patch
obsolete
>From aff99b295c47cc08e97ff9aaf0f996b7a65e3891 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 7 Oct 2021 14:31:10 +0000 >Subject: [PATCH] Bug 29192: Discard changes before logging a newly created > hold > >When logging a newly create hold it can have a dt object in the expiration date field >Per bug 28700 this does not get unblessed >We add an explicit call to discard changes to avoid logging a blessed datetime > >To test: > 1 - Enable HoldsLog in system preferences > 2 - Set system preferences: > DefaultHoldExpirationDate: Set > DefaultHoldExpirationdatePeriod: 5 > DefaultHoldExpirationdateUnitOfTime: days > 3 - Create a hold for a patron > 4 - Note the expiration date is set > 5 - Check the action logs - SELECT * FROM action_logs > 6 - Note that there is a lot of data, this is from DateTime object in expirationdate > 7 - Apply patch > 8 - Restart all > 9 - Place another hold >10 - Confirm expiration date set correctly >11 - View the logs >12 - Entry for new hold contains only the date, no extra data >--- > C4/Reserves.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index f2ee463979..972e31ca2f 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -261,6 +261,7 @@ sub AddReserve { > )->store(); > $hold->set_waiting() if $found && $found eq 'W'; > >+ $hold->discard_changes(); > logaction( 'HOLDS', 'CREATE', $hold->id, Dumper($hold->unblessed) ) > if C4::Context->preference('HoldsLog'); > >-- >2.20.1
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 29192
:
125889
|
125891
|
125898
|
125966