Bug 17924 - Fix error in password recovery
Summary: Fix error in password recovery
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords: Academy
Depends on:
Blocks:
 
Reported: 2017-01-17 14:45 UTC by Magnus Enger
Modified: 2019-06-27 09:24 UTC (History)
4 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:
Circulation function:


Attachments
Bug 17924 - Fix error in password recovery (1.42 KB, patch)
2017-01-17 14:58 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 17924 - Fix error in password recovery (1.47 KB, patch)
2017-01-18 02:10 UTC, Zoe Schoeler
Details | Diff | Splinter Review
Bug 17924 - Fix error in password recovery (1.53 KB, patch)
2017-01-19 12:03 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2017-01-17 14:45:39 UTC
To reproduce: 

- Set OpacResetPassword = allowed
- Make sure you have a user with a username and email 
- Go to the OPAC and make sure you are not logged in
- Click on the "Forgot your password?" link
- Fill in "Login" and "Email" and click on "Submit"

You will get an error that says:

Undefined subroutine &C4::Letters::GetPreparedLetter called at /home/vagrant/kohaclone/Koha/Patron/Password/Recovery.pm line 142.

Adding "use C4::Letters" to Koha/Patron/Password/Recovery.pm fixes this. Patch coming in a sec.
Comment 1 Magnus Enger 2017-01-17 14:58:43 UTC
Created attachment 59094 [details] [review]
Bug 17924 - Fix error in password recovery

To test:

- Set OpacResetPassword = allowed
- Make sure you have a user with a username and email
- Go to the OPAC and make sure you are not logged in
- Click on the "Forgot your password?" link
- Fill in "Login" and "Email" and click on "Submit"
- You will get an error that says:

Undefined subroutine &C4::Letters::GetPreparedLetter called at
/home/vagrant/kohaclone/Koha/Patron/Password/Recovery.pm line 142.

- Apply the patch
- The steps above will have added your user to the borrower_password_recovery
  table in the database. Delete it from there to make sure you start a
  fresh reset request.
- Repeat the steps above and notice that the error is gone. You should
  get a nice message instead that says "An email has been sent to [your
  email]".
- Sign off
Comment 2 Zoe Schoeler 2017-01-18 02:10:45 UTC
Created attachment 59132 [details] [review]
Bug 17924 - Fix error in password recovery

To test:

- Set OpacResetPassword = allowed
- Make sure you have a user with a username and email
- Go to the OPAC and make sure you are not logged in
- Click on the "Forgot your password?" link
- Fill in "Login" and "Email" and click on "Submit"
- You will get an error that says:

Undefined subroutine &C4::Letters::GetPreparedLetter called at
/home/vagrant/kohaclone/Koha/Patron/Password/Recovery.pm line 142.

- Apply the patch
- The steps above will have added your user to the borrower_password_recovery
  table in the database. Delete it from there to make sure you start a
  fresh reset request.
- Repeat the steps above and notice that the error is gone. You should
  get a nice message instead that says "An email has been sent to [your
  email]".
- Sign off

Signed-off-by: Zoe Schoeler <crazy.mental.onion@gmail.com>
Comment 3 Nick Clemens (kidclamp) 2017-01-19 12:03:33 UTC
Created attachment 59233 [details] [review]
Bug 17924 - Fix error in password recovery

To test:

- Set OpacResetPassword = allowed
- Make sure you have a user with a username and email
- Go to the OPAC and make sure you are not logged in
- Click on the "Forgot your password?" link
- Fill in "Login" and "Email" and click on "Submit"
- You will get an error that says:

Undefined subroutine &C4::Letters::GetPreparedLetter called at
/home/vagrant/kohaclone/Koha/Patron/Password/Recovery.pm line 142.

- Apply the patch
- The steps above will have added your user to the borrower_password_recovery
  table in the database. Delete it from there to make sure you start a
  fresh reset request.
- Repeat the steps above and notice that the error is gone. You should
  get a nice message instead that says "An email has been sent to [your
  email]".
- Sign off

Signed-off-by: Zoe Schoeler <crazy.mental.onion@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Nick Clemens (kidclamp) 2017-01-19 12:04:26 UTC
I don't actually get the error, but better to add the use explicitly
Comment 5 Kyle M Hall (khall) 2017-01-19 12:06:53 UTC
Pushed to master for 17.05, thanks Magnus!
Comment 6 Katrin Fischer 2017-01-22 18:36:06 UTC
This patch has been pushed to 16.11.x and will be in 16.11.02.
Comment 7 Mason James 2017-01-27 03:09:24 UTC
Pushed to 16.05.x, for 16.05.08 release