Bugzilla – Attachment 104506 Details for
Bug 25220
maxoutstanding syspref should be disabled by a null value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25220: maxoutstanding ignored if null in opac-reserve.pl
Bug-25220-maxoutstanding-ignored-if-null-in-opac-r.patch (text/plain), 1.62 KB, created by
Owen Leonard
on 2020-05-07 12:38:57 UTC
(
hide
)
Description:
Bug 25220: maxoutstanding ignored if null in opac-reserve.pl
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-05-07 12:38:57 UTC
Size:
1.62 KB
patch
obsolete
>From f8778b042f3605181bf97ef3a1da5d0955a861a7 Mon Sep 17 00:00:00 2001 >From: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Date: Tue, 21 Apr 2020 13:50:30 +0000 >Subject: [PATCH] Bug 25220: maxoutstanding ignored if null in opac-reserve.pl > >To Test: >1) set maxoutstanding to empty >2) give yourself a fine of $1 >3) try to place a hold on the opac >4) confirm you cannot place hold >5) apply patch, restart_all >6) reload opac >7) confirm hold is allowed >8) set maxoutstanding to $2 >9) confirm hold is now blocked > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > opac/opac-reserve.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 2a11ad48e5..b1fbc155a2 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -45,6 +45,8 @@ use Koha::Patrons; > use Date::Calc qw/Today Date_to_Days/; > use List::MoreUtils qw/uniq/; > >+use Scalar::Util qw(looks_like_number); >+ > my $maxreserves = C4::Context->preference("maxreserves"); > > my $query = new CGI; >@@ -339,9 +341,10 @@ if ( $query->param('place_reserve') ) { > # > my $noreserves = 0; > my $maxoutstanding = C4::Context->preference("maxoutstanding"); >+$maxoutstanding = undef unless looks_like_number($maxoutstanding); > $template->param( noreserve => 1 ) unless $maxoutstanding; > my $amountoutstanding = $patron->account->balance; >-if ( $amountoutstanding && ($amountoutstanding > $maxoutstanding) ) { >+if ( $amountoutstanding && defined($maxoutstanding) && ($amountoutstanding > $maxoutstanding) ) { > my $amount = sprintf "%.02f", $amountoutstanding; > $template->param( message => 1 ); > $noreserves = 1; >-- >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 25220
:
103377
|
103378
|
103388
| 104506 |
104507
|
104508