From 0d690ca383f49d62b1b040004e960596e1a39b2d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 11 Jun 2016 15:27:04 +0100 Subject: [PATCH] Bug 16707: Fix software error in OPAC password recovery when leaving form fields empty MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The $search_results is considered as an arrayref but is not defined if no patron matches the recovery infos. Test plan: - 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" => Without this patch you got the software error => With this patch apply, you will get "No account was found with the provided information." Sign-off on counter patch. Signed-off-by: Marc Véron Signed-off-by: Kyle M Hall Signed-off-by: Kyle M Hall --- 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 2f7fbfe2ac..257ca92505 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -54,7 +54,7 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { #try with the main email $email ||= ''; # avoid undef my $borrower; - my $search_results; + my $search_results = []; # Find the borrower by his userid or email if ($username) { -- 2.39.5