Bugzilla – Attachment 121494 Details for
Bug 27032
CanBookBeRenewed is not understandable and needs refactoring
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27032: (follow-up) Pass rather than fetch variables
Bug-27032-follow-up-Pass-rather-than-fetch-variabl.patch (text/plain), 1.83 KB, created by
Joonas Kylmälä
on 2021-05-28 16:26:19 UTC
(
hide
)
Description:
Bug 27032: (follow-up) Pass rather than fetch variables
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2021-05-28 16:26:19 UTC
Size:
1.83 KB
patch
obsolete
>From 8ae8f917bfc86a9fe09dbd64d8f12da9fc849b6d Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 22 Mar 2021 13:29:13 +0000 >Subject: [PATCH] Bug 27032: (follow-up) Pass rather than fetch variables >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Rebased-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> >--- > C4/Circulation.pm | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 7678980acb..b4f02cc7ad 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2790,7 +2790,12 @@ sub CanBookBeRenewed { > return ( 0, 'overdue'); > } > >- $auto_renew = _CanBookBeAutoRenewed($borrowernumber, $itemnumber); >+ $auto_renew = _CanBookBeAutoRenewed({ >+ patron => $patron, >+ item => $item, >+ branchcode => $branchcode, >+ issue => $issue >+ }); > return ( 0, $auto_renew ) if $auto_renew =~ 'auto_account_expired'; > return ( 0, $auto_renew ) if $auto_renew =~ 'auto_too_late'; > return ( 0, $auto_renew ) if $auto_renew =~ 'auto_too_much_oweing'; >@@ -4237,12 +4242,11 @@ sub _CalculateAndUpdateFine { > } > > sub _CanBookBeAutoRenewed { >- my ( $borrowernumber, $itemnumber ) = @_; >- >- my $item = Koha::Items->find($itemnumber); >- my $issue = $item->checkout; >- my $patron = $issue->patron; >- my $branchcode = _GetCircControlBranch( $item->unblessed, $patron->unblessed ); >+ my ( $params ) = @_; >+ my $patron = $params->{patron}; >+ my $item = $params->{item}; >+ my $branchcode = $params->{branchcode}; >+ my $issue = $params->{issue}; > > my $issuing_rule = Koha::CirculationRules->get_effective_rules( > { >-- >2.11.0
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 27032
:
113666
|
113667
|
113668
|
118593
|
118594
|
118595
|
121492
|
121493
|
121494
|
124780
|
124781
|
124782