Bugzilla – Attachment 150798 Details for
Bug 33611
Holds being placed in the future if DefaultHoldExpirationdate is set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33611: Ensure dt_from_string always returns a new object
Bug-33611-Ensure-dtfromstring-always-returns-a-new.patch (text/plain), 1.50 KB, created by
Hinemoea Viault
on 2023-05-08 15:16:27 UTC
(
hide
)
Description:
Bug 33611: Ensure dt_from_string always returns a new object
Filename:
MIME Type:
Creator:
Hinemoea Viault
Created:
2023-05-08 15:16:27 UTC
Size:
1.50 KB
patch
obsolete
>From 681b04c7b71b189aa117cb06fb917de3857520fb Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 27 Apr 2023 13:02:52 +0000 >Subject: [PATCH] Bug 33611: Ensure dt_from_string always returns a new object > >This patch alters dt_from_string to pass a cloned object if called >on an existing date time object > >This resolves an issue where a holds reserve date was being altered when >the default expiration date was set > >To test: >1 - Set DefaultHoldExpiration to Set >2 - Set DefaultHoldExpirationPeriod to 365 >3 - Set DefaultHoldExpirationunitOfTimeToDays >4 - Place a hold >5 - Note reserve date is 1 year in the future, same as expiration >6 - Apply patch >7 - Restart all >8 - Place another hold >9 - Note reserve date is set to today > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com> >--- > Koha/DateUtils.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 2ee889aac5..86c8314b4f 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -68,8 +68,8 @@ sub dt_from_string { > > $date_format = C4::Context->preference('dateformat') unless $date_format; > >- if ( ref($date_string) eq 'DateTime' ) { # already a dt return it >- return $date_string; >+ if ( ref($date_string) eq 'DateTime' ) { # already a dt return a clone >+ return $date_string->clone(); > } > > my $regex; >-- >2.34.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 33611
:
150223
|
150294
|
150295
|
150463
|
150464
|
150519
|
150520
|
150797
| 150798