Bugzilla – Attachment 154139 Details for
Bug 30362
GetSoonestRenewDate is technically wrong when NoRenewalBeforePrecision set to date soonest renewal is today
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date
Bug-30362-Fix-GetSoonestRenewDate-to-really-return.patch (text/plain), 2.12 KB, created by
Katrin Fischer
on 2023-08-01 21:45:22 UTC
(
hide
)
Description:
Bug 30362: Fix GetSoonestRenewDate to really return soonest renew date
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-08-01 21:45:22 UTC
Size:
2.12 KB
patch
obsolete
>From 820453c61850ea2f17b68802cd40e6bb6e33c399 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 20 Jul 2023 02:39:27 +0000 >Subject: [PATCH] Bug 30362: Fix GetSoonestRenewDate to really return soonest > renew date > >This change fixes GetSoonestRenewDate so that it returns the soonest >renew date as calculated using "No Renewal Before" and "NoRenewalBeforePrecision". >In the past, it would only return the soonest renew date if "$now" was >lesser than it, which would typically only happen when using an "exact" >precision rather than a "date" precision. > >Test plan: >0. Apply the patch >1. prove t/db_dependent/Circulation.t > >Signed-off-by: Sam Lau <samalau@gmail.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Circulation.pm | 2 +- > t/db_dependent/Circulation.t | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 5a6e036685..98c66828f5 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -3457,7 +3457,7 @@ sub GetSoonestRenewDate { > { > $soonestrenewal->truncate( to => 'day' ); > } >- return $soonestrenewal if $now < $soonestrenewal; >+ return $soonestrenewal; > } elsif ( $issue->auto_renew && $patron->autorenew_checkouts ) { > # Checkouts with auto-renewing fall back to due date > my $soonestrenewal = dt_from_string( $issue->date_due ); >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index f9a7c49a9d..6a722ac8c2 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -5869,12 +5869,13 @@ subtest "GetSoonestRenewDate tests" => sub { > rule_value => 1, > } > ); >- $issue->date_due( dt_from_string )->store; >+ $issue->date_due(dt_from_string)->store; > is( > GetSoonestRenewDate( $patron, $issue ), > dt_from_string->subtract( days => 1 )->truncate( to => 'day' ), > 'Checkouts with auto-renewal can be renewed 1 day before due date if no renewalbefore = 1 and precision = "date"' > ); >+ > }; > > subtest "CanBookBeIssued + needsconfirmation message" => sub { >-- >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 30362
:
132248
|
153694
|
153695
|
153736
|
153737
|
153738
|
154136
|
154137
|
154138
| 154139