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
Created attachment 113122 [details] [review] 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: - typo in 'use Koha::Patrons' defined twice => 'use Koha::Patron' - 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
You should only include Koha::Patrons (once, of course hehe).
Created attachment 113303 [details] [review] 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
Fridolin, I have encounter a problem while testing this patch. To recreate: 1. apply your patch 2. try opac-password-recovery.pl without an email, I see the new error message 3. in the staff client add an email for the same patron 4. try opac-password-recovery.pl again, it blows up with the error: Invalid 'from' parameter: root@localhost at /usr/share/perl5/Exception/Class/Base.pm line 88
(In reply to Lucas Gass from comment #4) > Fridolin, > > I have encounter a problem while testing this patch. To recreate: > > 1. apply your patch > 2. try opac-password-recovery.pl without an email, I see the new error > message > 3. in the staff client add an email for the same patron > 4. try opac-password-recovery.pl again, it blows up with the error: > Invalid 'from' parameter: root@localhost at > /usr/share/perl5/Exception/Class/Base.pm line 88 I think you need to set a real email adress into preference 'KohaAdminEmailAddress'. You may test without my patch first Thanks a lot for testing :D
> I think you need to set a real email adress into preference > 'KohaAdminEmailAddress'. > You may test without my patch first > > Thanks a lot for testing :D That is correct, if I use a real email address I get no such error.
Created attachment 114291 [details] [review] 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>
Created attachment 114543 [details] [review] 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>
works, QA script ok, code looks good
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.01
Doesn't apply cleanly to 20.05. Please rebase if needed.