Koha/t
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
..
Acquisition Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblio Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
Budgets Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Circulation Bug 28931: Use EXPORT_OK from Koha::DateUtils 2021-10-07 11:01:05 +02:00
data Bug 28998: Add encryption_key to the config file 2022-05-04 05:18:31 -10:00
db_dependent Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-10-24 14:12:16 -03:00
edi_testfiles
etc
External Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Koha Bug 17170: (QA follow-up) Adjust t/Koha/Auth/Permissions.t 2022-10-24 09:11:55 -03:00
lib Bug 17170: Add API route for SearchFilters 2022-10-21 11:15:14 -03:00
Members Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Number
Search Bug 23919: Add tests for biblioItems search by ISBN and ISSN with 2022-08-01 13:21:50 -03:00
Serials Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SIP Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Test
00-check-atomic-updates.t Bug 31108: rename ./t/00-check-atomic-updates.pl extension to *.t 2022-07-06 16:40:51 -03:00
00-checkdatabase-version.t
00-deprecated.t
00-load.t
00-merge-conflict-markers.t
00-testcritic.t
00-valid-xml.t
Auth.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Auth_with_shibboleth.t Bug 30646: Unit test for Auth_with_shibboleth 2022-10-03 14:02:40 -03:00
AuthoritiesMarc_MARC21.t Bug 31023: Unit tests 2022-09-07 13:52:35 -07:00
AuthoritiesMarc_UNIMARC.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Barcodes_annual.t
Barcodes_EAN13.t
Barcodes_hbyymmincr.t
Barcodes_incremental.t
Biblio.t Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Biblio2.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Budgets.t
Calendar.t Bug 28931: Use EXPORT_OK from Koha::DateUtils 2021-10-07 11:01:05 +02:00
Charset.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Circulation_barcodedecode.t Bug 30409: (QA follow-up) Avoid uninitialized variable warnings 2022-06-14 08:26:58 -03:00
ClassSortRoutine.t
ClassSortRoutine_Dewey.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSortRoutine_Generic.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSortRoutine_LCC.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSource.t
Context.t Bug 29744: (QA follow-up) Only consider PLACK_ENV for underscore 2022-09-23 12:05:05 -03:00
Contract.t
CookieManager.t Bug 31250: (QA follow-up) The future will be easier 2022-09-12 15:34:11 -03:00
Creators.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
DateUtils.t Bug 30717: (QA follow-up) Move to module 2022-05-13 15:41:55 -10:00
dummy.t
Edifact.t Bug 30135: (follow-up) Rename accessor in failing test 2022-04-14 11:43:43 +01:00
EdiInvoice.t
Ediorder.t Bug 31134: Mock EdifactLSQ for t/Edifact.t 2022-07-18 10:20:44 -03:00
Ediordrsp.t
EdiTransport.t
Form_MessagingPreferences.t
HtmlTags.t
ImportBatch.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Installer_PerlModules.t Bug 30731: Unit tests 2022-06-01 16:15:25 -03:00
ItemCirculationAlertPreference.t
Koha.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Koha_MetadataRecord.t Bug 30813: (follow-up) Fix tests import 2022-06-08 13:41:14 -03:00
Koha_SearchEngine_Elasticsearch_Browse.t
Koha_Template_Plugin_Cache.t
Koha_Template_Plugin_HtmlId.t
Koha_Template_Plugin_Koha.t Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed 2022-09-07 13:55:37 -07:00
Koha_Util_FrameworkPlugin.t
Koha_Util_MARC.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Labels.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Labels_split_ccn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_ddcn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_lccn.t Bug 30110: Fix concatenation during assignements 2022-03-24 14:22:10 -10:00
Labels_split_Regex.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Languages.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Letters.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Logger.t Bug 25464: Add ability to specify client IP and SIP account used in SIP2 logging 2021-07-26 12:46:32 +02:00
Makefile.t Bug 31528: (QA follow-up) Exclude .stylelintrc.json in Makefile.t 2022-10-03 09:54:34 -03:00
Matcher.t Bug 28290: (follow-up) Unit test 2022-09-07 13:50:37 -07:00
Members_Messaging.t
OpenLibrarySearch.t
Output.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Output_JSONStream.t
Patron.t
Patroncards.t
Patroncards_Batch.t
Patroncards_Lib.t
Patroncards_Patroncard.t
Patroncards_Profile.t
Patroncards_Template.t
Prices.t Bug 29955: Move populate_order_with_prices to Koha namespace 2022-08-19 15:47:51 -03:00
RecordProcessor.t
Ris.t
Scheduler.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Scrubber.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Search.t Bug 29697: Fix t/Search.t 2022-07-25 09:33:36 -03:00
Search_PazPar2.t
SimpleMARC.t Bug 31644: (QA follow-up) Add two missing shebang lines 2022-10-24 11:53:19 -03:00
SMS.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SocialData.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Stats.t
SuggestionEngine.t
SuggestionEngine_AuthorityFile.t
template_filters.t Bug 29350: Don't need to escape the 'delete' TT methods 2021-11-02 15:58:08 +01:00
timezones.t Bug 28306: Allow to query database with minimal memory footprint 2021-08-31 10:27:52 +02:00
TmplToken.t Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Token.t Bug 27849: (follow-up) Add test 2022-08-01 09:53:35 -03:00
XSLT.t