Bugzilla – Attachment 128095 Details for
Bug 29537
Simplify auto-renewal code in CanBookBeRenewed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29537: Remove unnecessary if-else checks for soonest renew date
Bug-29537-Remove-unnecessary-if-else-checks-for-so.patch (text/plain), 1.51 KB, created by
David Nind
on 2021-11-29 21:38:11 UTC
(
hide
)
Description:
Bug 29537: Remove unnecessary if-else checks for soonest renew date
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-11-29 21:38:11 UTC
Size:
1.51 KB
patch
obsolete
>From 5d8f377fe4d21d69fc2c4d6199a3a9c95b89df82 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= <joonas.kylmala@iki.fi> >Date: Sat, 20 Nov 2021 11:48:55 +0000 >Subject: [PATCH] Bug 29537: Remove unnecessary if-else checks for soonest > renew date > >GetSoonestRenewDate() calculates the renewal due date now also >correctly for auto-renewals after the fixes from bug 29476 so we don't >have to add any if-else checks because of it being buggy anymore. > >To test: > 1) prove t/db_dependent/Circulation.t > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Circulation.pm | 18 +++--------------- > 1 file changed, 3 insertions(+), 15 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index c6b9e7683b..d4cca7b1b1 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -4316,23 +4316,11 @@ sub _CanBookBeAutoRenewed { > } > } > >- if ( defined $issuing_rule->{norenewalbefore} >- and $issuing_rule->{norenewalbefore} ne "" ) { >- if ( $soonest_renew_date > dt_from_string()) { >- return "auto_too_soon"; >- } else { >- return "ok"; >- } >+ if ( $soonest_renew_date > dt_from_string()) { >+ return "auto_too_soon"; > } > >- # Fallback for automatic renewals: >- # If norenewalbefore is undef, don't renew before due date. >- my $now = dt_from_string; >- if ( $now >= dt_from_string( $issue->date_due, 'sql' ) ){ >- return "ok"; >- } else { >- return "auto_too_soon"; >- } >+ return "ok"; > } > > sub _item_denied_renewal { >-- >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 29537
:
127901
|
127902
|
128095
|
132129
|
133505
|
134348