From 47e78f5c290f14c2af53e747ebae7ec317a0dbbd Mon Sep 17 00:00:00 2001 From: Gus Date: Tue, 19 Jan 2016 03:12:48 +0000 Subject: [PATCH] Bug 14930 - Leaving OpacFineNoRenewals blank blocks renewals, but should disable feature MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit To Test - Borrower has some fines and checkouts - Leave OPACFineNoRenewals empty/blank - Try to renew items in the OPAC - notice error message - Add a big value to OpacFineNoRenewals - notice renewals work Leaving the OPACFineNoRenewals empty will disable the feature. Patch works as expected.(Amended to format the commit message and to remove a warn on line 112 / MV) Signed-off-by: Marc Véron Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- opac/opac-user.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 9d1f9b2dd8..e9529b5ec5 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -107,9 +107,9 @@ if ( 5 >= $borr->{'amountoutstanding'} && $borr->{'amountoutstanding'} > 0 ) { $borr->{'amountoverzero'} = 1; } my $no_renewal_amt = C4::Context->preference( 'OPACFineNoRenewals' ); -$no_renewal_amt ||= 0; +$no_renewal_amt ||= undef; -if ( C4::Context->preference( 'OpacRenewalAllowed' ) && $borr->{amountoutstanding} > $no_renewal_amt ) { +if ( C4::Context->preference( 'OpacRenewalAllowed' ) && $no_renewal_amt && $borr->{amountoutstanding} > $no_renewal_amt ) { $borr->{'flagged'} = 1; $canrenew = 0; $template->param( -- 2.39.2