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 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
default_messageprefs.pl
deletemem.pl Bug 23991: Move SearchSuggestion to Koha::Suggestions 2022-06-27 12:30:28 -03:00
discharge.pl
discharges.pl
files.pl
holdshistory.pl
housebound.pl Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
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 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: Treat flags as other borrower fields 2022-09-22 09:24:41 -03: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
members-update.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
merge-patrons.pl
mod_debarment.pl Bug 23681: Allow for selection of restriction type 2022-08-25 08:41:01 -03:00
moremember.pl Bug 23681: Move to ::Patron::Restriction::Type(s) 2022-08-25 08:50:35 -03:00
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 Bug 29541: Prevent users from another group to access patron's images 2022-02-02 21:05:29 -10:00
pay.pl
paycollect.pl Bug 31254: Add additional fields for accountlines 2022-09-21 18:58:28 -03:00
print_overdues.pl Bug 30420: Rename Koha::Patron->get_overdues with ->overdues 2022-06-14 08:46:05 -03:00
printfeercpt.pl Bug 26689: Prepend letter codes. 2022-07-22 15:01:36 -03:00
printinvoice.pl Bug 26689: Prepend letter codes. 2022-07-22 15:01:36 -03:00
printnotice.pl Bug 31714: Add Generic way to print patron slips 2022-10-21 10:09:03 -03:00
printslip.pl
purchase-suggestions.pl Bug 23991: Move SearchSuggestion to Koha::Suggestions 2022-06-27 12:30:28 -03:00
readingrec.pl Bug 23838: Add renewals modal 2022-07-22 11:39:09 -03:00
recallshistory.pl Bug 30291: Changes to staff client files 2022-05-05 11:17:36 -10:00
routing-lists.pl
search.pl Bug 30093: Make patron search from request.pl use the REST API 2022-04-04 09:47:00 +02:00
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 Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00