Koha/Koha/Patron
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
..
Attribute Bug 8326: Make repeatable and unique_id modifiable when editing patron attribute type 2021-02-15 11:48:55 +01:00
Password Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-10-24 14:12:16 -03:00
Restriction Bug 23681: Move to ::Patron::Restriction::Type(s) 2022-08-25 08:50:35 -03:00
Attribute.pm Bug 28031: Remove type from parameter of *_ok methods 2021-04-09 15:43:34 +02:00
Attributes.pm Bug 29844: Fix t/db_dependent/Koha/* 2022-02-09 15:36:23 -10:00
Categories.pm Bug 23271: (QA follow-up) Minor POD fix 2021-04-21 15:25:07 +02:00
Category.pm Bug 31333: (QA follow-up) Simplify code 2022-10-05 16:01:06 -03:00
Consent.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Consents.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Debarments.pm Bug 29395: use EXPORT_OK from Koha::Patron::Debarments 2021-11-03 15:40:52 +01:00
Discharge.pm Bug 29395: use EXPORT_OK from Koha::Patron::Debarments 2021-11-03 15:40:52 +01:00
Files.pm Bug 28572: Remove C4::Debug 2021-06-22 12:04:32 +02:00
HouseboundProfile.pm Bug 29847: Make Koha::Patron::HouseboundProfile->housebound_visits return a resultset 2022-02-09 15:36:23 -10:00
HouseboundProfiles.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
HouseboundRole.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
HouseboundRoles.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
HouseboundVisit.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
HouseboundVisits.pm Bug 24545: Fix license statements 2020-02-24 13:31:26 +00:00
Image.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Images.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Message.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Messages.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Modification.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Modifications.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Relationship.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Relationships.pm Bug 29844: Fix t/db_dependent/Koha/* 2022-02-09 15:36:23 -10:00