Bugzilla – Attachment 134348 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.62 KB, created by
Marcel de Rooy
on 2022-04-29 08:32:41 UTC
(
hide
)
Description:
Bug 29537: Remove unnecessary if-else checks for soonest renew date
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-04-29 08:32:41 UTC
Size:
1.62 KB
patch
obsolete
>From 475014d048d8d8fdad68c2122ebd95ac68f2329f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 24 Mar 2022 11:42:55 +0000 >Subject: [PATCH] Bug 29537: Remove unnecessary if-else checks for soonest > renew date >Content-Type: text/plain; charset=utf-8 > >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> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Circulation.pm | 19 ++++--------------- > 1 file changed, 4 insertions(+), 15 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index d0f292650d..abd0a5ca5d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -4457,23 +4457,12 @@ sub _CanBookBeAutoRenewed { > } > } > >- if ( defined $issuing_rule->{norenewalbefore} >- and $issuing_rule->{norenewalbefore} ne "" ) { >- if ( GetSoonestRenewDate($patron->id, $item->id) > dt_from_string()) { >- return "auto_too_soon"; >- } else { >- return "ok"; >- } >- } >- >- # 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 { >+ if ( GetSoonestRenewDate( $patron->id, $item->id ) > dt_from_string() ) >+ { > 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