Koha-clms/members
Björn Nylén 7a33e61858 Bug 31739: Password recovery from staff fails if previous expired reset-entry exists.
SendPasswordRecoveryEmail relies on the calling script to tell if there is an
existing valid recovery already. If there's an expired recovery-entry the
members/notices.pl script will try to create a new entry resulting in a duplicate
key error.

This patch fixes the bug by removing the need for the calling script to do the check as
since SendPasswordRecoveryEmail does the same thing anyway.
SendPasswordRecoveryEmail will now use DBIx ->update_or_create instead of looking at
the $update param to determine if it should update an existing entry or create a new.

The update param is removed from all calling scripts and test are updated.

To test:
1. Generate a password recovery mail for a patron
2. Let it expire.
3. Generate a new password recovery from staff to the same patron - Fail!
4: Apply patch
5. Generate a new password recovery from staff to the same patron - Success!
6. Opac password recovery flow should also work.
7. Tests pass.

Sponsored-by: Lund University Library

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 043017af13)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2022-12-05 22:38:12 +00:00
..
accountline-details.pl Bug 22435: Update accountline-details page to show all history 2021-08-04 14:06:43 +02:00
apikeys.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
boraccount.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
cancel-charge.pl Bug 29457: Pass context borrowernumber 2021-12-21 20:44:15 -10:00
default_messageprefs.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
deletemem.pl Bug 27145: Wrap delete and move_to_deleted in a transaction 2021-11-15 12:38:39 +01:00
discharge.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
discharges.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
files.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
holdshistory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
housebound.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ill-requests.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
mancredit.pl Bug 29987: (follow-up) Fix missing payment type 2022-12-05 21:15:41 +00:00
maninvoice.pl Bug 29859: Use iterator instead of as_list 2022-02-09 15:36:23 -10:00
member-flags.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
member-password.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
member.pl Bug 30485: (bug 30063 follow-up) Display all patrons if not term passed 2022-04-13 15:55:39 +02:00
memberentry.pl Bug 31562: [22.05.x] Treat flags as other borrower fields 2022-11-01 14:08:01 +00:00
members-home.pl Bug 30485: (bug 30063 follow-up) Display all patrons if not term passed 2022-04-13 15:55:39 +02:00
members-update-do.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
members-update.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
merge-patrons.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
mod_debarment.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
moremember.pl Bug 30905: Show waiting recalls in patron account 2022-08-23 19:43:54 +00:00
notices.pl Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-12-05 22:38:12 +00:00
patronimage.pl Bug 29541: Prevent users from another group to access patron's images 2022-02-02 21:05:29 -10:00
pay.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
paycollect.pl Bug 30807: Migrate to patron-title in pay and paycollect 2022-07-12 19:16:23 +00:00
print_overdues.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
printfeercpt.pl Bug 26689: Prepend letter codes. 2022-09-02 17:55:09 +00:00
printinvoice.pl Bug 26689: Prepend letter codes. 2022-09-02 17:55:09 +00:00
printslip.pl Bug 29062: Use primary key issued_id to fetch old_issues for letters 2021-10-07 15:49:01 +02:00
purchase-suggestions.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
readingrec.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
recallshistory.pl Bug 30291: Changes to staff client files 2022-05-05 11:17:36 -10:00
routing-lists.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
search.pl Bug 30093: Make patron search from request.pl use the REST API 2022-04-04 09:47:00 +02:00
setstatus.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
statistics.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
summary-print.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
two_factor_auth.pl Bug 28998: (QA follow-up) Improve output on error 2022-05-04 05:18:31 -10:00
update-child.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00