Koha/t/db_dependent
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 31649: Add unit tests 2022-10-11 10:00:08 -03:00
api/v1 Bug 30588: (QA follow-up) Remove erroneous FIXME 2022-10-21 11:36:59 -03:00
Auth
AuthoritiesMarc
Authority Bug 29697: Replace GetMarcBiblio occurrences with $biblio->metadata->record 2022-07-22 15:24:11 -03:00
Biblio Bug 29697: Fix tests 2022-07-22 15:24:11 -03:00
Budgets Bug 27550: Add unit test for CloneBudgetHierarchy 2022-09-22 08:18:43 -03:00
Circulation Bug 25426: (QA follow-up) Make subtest stand on its own 2022-10-18 09:35:17 -03:00
CourseReserves
Creators
cronjobs
data Bug 29697: Fix t/db_dependent/Search.t 2022-07-25 10:16:48 -03:00
Exporter
Holds Bug 14364: Fix spelling and tests 2022-07-29 16:00:34 -03:00
Illrequest Bug 30484: Add unit tests 2022-09-23 09:18:46 -03:00
Items Bug 27272: Remove GetItemsInfo, GetItemsLocationInfo and GetHostItemsInfo 2022-08-31 17:50:51 -03:00
Koha Revert "Bug 15187: (QA follow-up) Add unit test" 2022-10-24 14:04:07 -03:00
Labels Bug 24001: (follow-up) Fix t_Profile.t 2022-04-28 20:26:20 -10:00
LDAP
Letters Bug 28739: Execute the letter processing inside a transaction 2022-07-08 15:40:04 -03:00
Members
misc/translator
OAI Bug 29697: Replace some missing occurrences 2022-07-25 09:30:30 -03:00
Patron Bug 30076: Add ability to check patron messaging preferences from a notice 2022-04-08 15:49:16 +02:00
Record Bug 29697: Use flag embed_items 2022-07-22 15:24:11 -03:00
Reports Bug 26669: Last Run if report not always updated 2022-04-04 16:23:46 +02:00
Reserves Bug 29976: (Bug 21729 follow-up) fix holds unit tests 2022-02-01 21:39:39 -10:00
Search
selenium Bug 30588: Add selenium tests 2022-10-21 11:36:58 -03:00
Serials
SIP Bug 31552: SIP2 option format_due_date not honored for AH field in item information response 2022-10-12 14:56:57 -03:00
Template/Plugin Bug 29826: Manage call of Template Plugin Branches GetName() with null or empty branchcode 2022-03-03 16:11:50 -10:00
Utils Bug 30063: Remove occurrences of C4::Utils::DataTables::Members 2022-04-04 09:47:01 +02:00
www
00-strict.t
01-test_dbic.t
Accounts.t Bug 28854: Unit tests - chargelostitem 2022-07-13 10:35:50 -03:00
Acquisition.t Bug 31115: Add additional_attributes support to GetInvoices 2022-10-24 14:11:07 -03:00
Amazon.t
ArticleRequests.t
AudioAlerts.t Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Auth.t Bug 30588: (QA follow-up) Auth - remove two warns and second logout 2022-10-21 11:37:00 -03:00
Auth_with_cas.t
Auth_with_ldap.t Bug 30646: Unit tests for Auth_with_ldap 2022-10-03 14:02:40 -03:00
AuthorisedValues.t Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
AuthoritiesMarc.t
AuthoritiesMarc_GetTagsLabels.t Bug 30446: Add a test for GetTagsLabels 2022-04-21 21:01:09 -10:00
AuthUtils.t
BackgroundJob.t
Barcodes.t
Barcodes_ValueBuilder.t Bug 26328: Add test 2022-03-23 10:50:51 -10:00
Biblio.t Bug 30025: Split BiblioAddsAuthorities into two sysprefs 2022-09-16 16:48:30 -03:00
Biblio_holdsqueue.t Bug 30728: Add unit tests 2022-05-12 22:17:46 -10:00
Breeding.t Bug 30813: Remove TransformMarcToKohaOneField 2022-06-08 11:40:30 -03:00
Budgets.t Bug 30359: Unit tests 2022-09-21 19:02:22 -03:00
Cache.t
Calendar.t
Charset.t
check_kohastructure.t
check_sysprefs.t
Circulation.t Bug 31676: Fix db_dependent/Circulation.t tests 2022-10-24 11:01:02 -03:00
Circulation_holdsqueue.t Bug 30728: Add unit tests 2022-05-12 22:17:46 -10:00
Clubs.t Bug 29736: (QA follow-up) No need to delete all clubs 2022-01-13 16:37:33 -10:00
Context.t Bug 31870: Add license, remove unused modules 2022-10-24 11:26:10 -03:00
Contract.t
CourseReserves.t
db_structure.t
DecreaseLoanHighHolds.t Bug 29562: Fix DecreaseLoanHighHolds.t 2022-01-31 21:55:40 -10:00
Filter_MARC_ViewPolicy.t
Fines.t
FrameworkPlugin.t
Heading.t
Heading_MARC21.t
Hold.t Bug 14783: (QA follow-up) Rename method and move tests 2022-10-17 15:43:22 -03:00
Holds.t Bug 31920: Add transaction to subtest in t/db_dependent/Holds.t 2022-10-24 11:00:03 -03:00
HoldsQueue.t
Holidays.t
Illcomments.t
Illrequestattributes.t
Illrequests.t Bug 30484: (follow-up) Fix tests 2022-09-23 09:33:48 -03:00
ILSDI_Services.t Bug 29924: Update ILSDI to be aware of expired passwords 2022-05-06 10:33:09 -10:00
ImportBatch.t Bug 30779: Remove _update_import_record_marc and update tests 2022-08-18 09:02:04 -03:00
ImportExportFramework.t Bug 13952: (follow-up) Tests 2022-04-04 16:23:45 +02:00
Installer.t
Items.t Bug 28799: Log when item was lost and now found 2022-10-11 10:43:36 -03:00
Koha.t Bug 30870: Don't skip tests if Test::Deep if not installed 2022-06-01 13:40:26 -03:00
Koha_Database.t
Koha_Elasticsearch.t
Koha_ExternalContent_OverDrive.t
Koha_ExternalContent_RecordedBooks.t
Koha_MetadataRecord_Authority.t Bug 30756: Rename to Koha_MetadataRecord_Authority 2022-06-02 13:53:39 -03:00
Koha_Misc_Files.t
Languages.t
Letters.t Bug 31626: Add letter id to the message queue table 2022-10-18 09:41:41 -03:00
LibraryGroups.t Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Linker_Default.t Bug 30280: Add Unit tests 2022-10-03 10:00:12 -03:00
Linker_FirstMatch.t
Log.t Bug 27342: (QA follow-up) Fix test 2022-08-16 10:50:47 -03:00
MarcModificationTemplates.t Bug 31644: (QA follow-up) Add two missing shebang lines 2022-10-24 11:53:19 -03:00
Members.t Bug 28962: Add del-unv-selfreg to crontab 2022-01-21 21:34:51 -10:00
Message.t
MungeMarcPrice.t
Overdues.t Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Passwordrecovery.t Bug 31739: Password recovery from staff fails if previous expired reset-entry exists. 2022-10-24 14:12:16 -03:00
Patroncards.t
PatronLists.t
Patrons.t Bug 12446: (QA follow-up) Rename canbeguarantee => can_be_guarantee 2022-06-23 13:34:05 -03:00
Record.t
RecordProcessor_EmbedSeeFromHeadings.t
Reports.t
Reserves.t Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
rollingloans.t
RotatingCollections.t Bug 29144: Remove opac_info from a few tests 2022-09-16 09:55:20 -03:00
Search.t Bug 29697: (QA follow-up) Remove useless warning 2022-08-31 12:34:39 -03:00
Serials.t Bug 30718: Use flatpickr's altInput 2022-08-19 08:26:31 -03:00
Serials_2.t
Service.t
ShelfBrowser.t
Sitemapper.t
Stats.t Bug 19532: Other objects used in recalls feature 2022-03-14 22:45:51 -10:00
StockRotationItems.t Bug 30518: Unit test 2022-04-19 21:25:50 -10:00
StockRotationRotas.t
StockRotationStages.t Bug 29809: Fix StockRotationStages.t 2022-01-31 21:55:40 -10:00
SuggestionEngine_ExplodedTerms.t Bug 31069: Remove ExplodedTerms dependency on templates 2022-07-18 12:37:35 -03:00
Suggestions.t Bug 23991: Move SearchSuggestion to Koha::Suggestions 2022-06-27 12:30:28 -03:00
sysprefs.t
TablesSettings.t
Tags.t
Templates.t Bug 29695: Remove GetColumnDefs 2022-04-12 11:40:16 +02:00
TestBuilder.t Bug 29862: Add missing txn begin/rollback in TestBuilder.t 2022-01-31 21:55:40 -10:00
Upload.t Bug 31598: Fix random failure on Jenkins for Upload.t 2022-09-22 08:07:01 -03:00
UsageStats.t
Virtualshelves.t Bug 30933: (follow-up) Consolidate transfer checks 2022-07-20 09:04:07 -03:00
XISBN.t
XSLT.t Bug 30921: Replace C4::XSLT::transformMARCXML4XSLT with RecordProcessor 2022-09-12 16:26:34 -03:00
yaml.t
zebra_config.pl