Bug 16707 - Software Error in OPAC password recovery when leaving form fields empty
Summary: Software Error in OPAC password recovery when leaving form fields empty
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 8753
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-10 12:47 UTC by Marc Véron
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16707: Software Error in OPAC password recovery when leaving form fields empty (1.48 KB, patch)
2016-06-10 13:21 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 16707: Software Error in OPAC password recovery when leaving form fields empty (1.58 KB, patch)
2016-06-10 16:58 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 16707: Fix software error in OPAC password recovery when leaving form fields empty (1.29 KB, patch)
2016-06-11 14:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16707: Fix software error in OPAC password recovery when leaving form fields empty (1.45 KB, patch)
2016-06-12 09:21 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 16707: Fix software error in OPAC password recovery when leaving form fields empty (1.50 KB, patch)
2016-06-17 16:35 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2016-06-10 12:47:58 UTC
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.
Comment 1 Marc Véron 2016-06-10 13:21:25 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-06-10 16:58:31 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-06-11 14:30:26 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2016-06-11 14:31:34 UTC
Marc, the eval is a bit weird here. Please have a look at my counter patch.
Comment 5 Marc Véron 2016-06-12 09:21:54 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2016-06-17 16:35:00 UTC
Created attachment 52495 [details] [review]
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."

Sign-off on counter patch.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Kyle M Hall 2016-06-24 11:49:38 UTC
Pushed to master for 16.11, thanks Jonathan!
Comment 8 Frédéric Demians 2016-08-01 11:50:03 UTC
Pushed in 16.05. Will be in 16.05.02.
Comment 9 Julian Maurice 2016-08-16 12:28:01 UTC
Not needed in 3.22.x