Koha/members
Björn Nylén 043017af13
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>
2022-10-24 14:12:16 -03:00
..
accountline-details.pl
apikeys.pl
boraccount.pl
cancel-charge.pl
default_messageprefs.pl
deletemem.pl
discharge.pl
discharges.pl
files.pl
holdshistory.pl
housebound.pl
ill-requests.pl
mancredit.pl Bug 29987: (follow-up) Fix missing payment type 2022-10-21 10:18:53 -03:00
maninvoice.pl Bug 31254: Add additional fields for accountlines 2022-09-21 18:58:28 -03:00
member-flags.pl
member-password.pl
member.pl
memberentry.pl Bug 31562: Treat flags as other borrower fields 2022-09-22 09:24:41 -03:00
members-home.pl
members-update-do.pl
members-update.pl
merge-patrons.pl
mod_debarment.pl
moremember.pl
notices.pl Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-10-24 14:12:16 -03:00
patronimage.pl
pay.pl
paycollect.pl Bug 31254: Add additional fields for accountlines 2022-09-21 18:58:28 -03:00
print_overdues.pl
printfeercpt.pl
printinvoice.pl
printnotice.pl Bug 31714: Add Generic way to print patron slips 2022-10-21 10:09:03 -03:00
printslip.pl
purchase-suggestions.pl
readingrec.pl
recallshistory.pl
routing-lists.pl
search.pl
setstatus.pl
statistics.pl
summary-print.pl
two_factor_auth.pl Bug 30588: (QA follow-up) Adjust flags for two_factor_auth.pl 2022-10-21 11:37:01 -03:00
update-child.pl