Bug 26941: Fix OPAC password recovery error messages
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 5 Nov 2020 14:52:47 +0000 (15:52 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 21 Dec 2020 09:08:02 +0000 (10:08 +0100)
commit470c7606695bff93a6c6f4491227bfb6705c21e8
treed1a42eec88fe79ad283f0644f65826ec52283cea
parent080288bce48cf4fa94b19d35a117dd3e1967a4c9
Bug 26941: Fix OPAC password recovery error messages

In OPAC password recovery perl opac/opac-password-recovery.pl
there are some error codes not in Template koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt

This patch fixes several bugs:
- remove 'use Koha::Patrons' defined twice
- remove vars $errTooManyEmailFound $errBadEmail, not used in any template
- add in template text for error 'errNoBorrowerEmail'

1) Create a patron A with login but no email
2) Create a patron B with login and valid email
3) Go to system preferences set 'OpacResetPassword' to ON
4) Make sure that OpacPasswordChange is also ON
5) Go to 'Forgot your password' in OPAC
6) Enter login if patron A and save
=> You get message 'This account has no email address we can send the email to.'
7) Enter login if patron B and save
=> Password recovery is send, no error message

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-password-recovery.tt
opac/opac-password-recovery.pl