From ce73fdcbf5ed66b10e650dc1e3270b0cc8a348e1 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 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." --- 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..257ca92 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.8.1