From 73030f7a09808ba8415fbe90ec5e5ce40a956169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Fri, 10 Jun 2016 15:12:29 +0200 Subject: [PATCH] [SIGNED-OFF]Bug 16707: Software Error in OPAC password recovery when leaving form fields empty This patch fixes a software Error in OPAC password recovery when leaving form fields empty To reproduce: - Set syspref OpacResetPassword to "Allow" - Go to OPAC - Click link "Forgot your password? - On the following screen "Forgotten password recovery", do not fill in form fields, click "Submit" Result: Software error: Can't use an undefined value as an ARRAY reference at /usr/share/kohaclone/opac/opac-password-recovery.pl line 66. To test: - Apply patch - Verify that the error no longer occurs Signed-off-by: Hector Castro Work as expected. NO QA Test Tool errors --- opac/opac-password-recovery.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index 2f7fbfe..37fa3a0 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -63,7 +63,7 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { elsif ($email) { $search_results = [ Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) ]; } - if ( not $search_results || scalar @$search_results > 1 ) { + if ( not $search_results || eval { scalar @$search_results > 1 } ) { $hasError = 1; $errNoBorrowerFound = 1; } -- 1.7.10.4