Bug 40082 - PatronDuplicateMatchingAddFields isn't respected in the OPAC or the API
Summary: PatronDuplicateMatchingAddFields isn't respected in the OPAC or the API
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Matt Blenkinsop
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-05 12:37 UTC by Matt Blenkinsop
Modified: 2025-06-05 12:52 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40082: Move the duplicate matching logic to the Koha::Patrons class (2.34 KB, patch)
2025-06-05 12:49 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40082: Use the new duplicate checking method in the API (1.87 KB, patch)
2025-06-05 12:49 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40082: Use the new duplicate checking method in the OPAC (2.87 KB, patch)
2025-06-05 12:49 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40082: Add unit tests (6.97 KB, patch)
2025-06-05 12:49 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40082: Move the duplicate matching logic to the Koha::Patrons class (2.53 KB, patch)
2025-06-05 12:52 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40082: Use the new duplicate checking method in the API (1.87 KB, patch)
2025-06-05 12:52 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40082: Use the new duplicate checking method in the OPAC (2.87 KB, patch)
2025-06-05 12:52 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40082: Add unit tests (6.97 KB, patch)
2025-06-05 12:52 UTC, Matt Blenkinsop
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Blenkinsop 2025-06-05 12:37:19 UTC
There is a syspref for checking new patrons for duplicates that is only implemented in the staff interface - it should also be respected when adding a patron via the API or the OPAC
Comment 1 Matt Blenkinsop 2025-06-05 12:49:46 UTC
Created attachment 182990 [details] [review]
Bug 40082: Move the duplicate matching logic to the Koha::Patrons class
Comment 2 Matt Blenkinsop 2025-06-05 12:49:49 UTC
Created attachment 182991 [details] [review]
Bug 40082: Use the new duplicate checking method in the API
Comment 3 Matt Blenkinsop 2025-06-05 12:49:52 UTC
Created attachment 182992 [details] [review]
Bug 40082: Use the new duplicate checking method in the OPAC
Comment 4 Matt Blenkinsop 2025-06-05 12:49:55 UTC
Created attachment 182993 [details] [review]
Bug 40082: Add unit tests

Test plan:
1) Choose an existing patron and note their first and second names as well as their date of birth
2) In the interface, create a new patron and enter all of those details to be the same as your patron from step 1
3) Submit the form, you will get a warning saying that there is a duplicate
4) In the OPAC, self register a new patron using the same details again
5) The form should submit with no error or warning
6) Apply patch, yarn api:bundle and restart_all
7) Repeat steps 2 - 5
8) Step 3 should still have the same behaviour
9) Step 5 should now show a warning at the top to say that there is a duplicate, please contact a member of staff
10) Find the 'PatronDuplicateMatchingAddFields' syspref and select an extra field there, ensuring that your patron from step 1 has data for that field
11) In either the interface or the OPAC, register a new patron but this time change the data of the new field you added in step 10
12) No warning should show for a duplicate patron
13) prove t/db_dependent/api/v1/patrons.t
14) prove t/db_dependent/Koha/Patrons.t
Comment 5 Matt Blenkinsop 2025-06-05 12:52:35 UTC
Created attachment 182994 [details] [review]
Bug 40082: Move the duplicate matching logic to the Koha::Patrons class
Comment 6 Matt Blenkinsop 2025-06-05 12:52:37 UTC
Created attachment 182995 [details] [review]
Bug 40082: Use the new duplicate checking method in the API
Comment 7 Matt Blenkinsop 2025-06-05 12:52:40 UTC
Created attachment 182996 [details] [review]
Bug 40082: Use the new duplicate checking method in the OPAC
Comment 8 Matt Blenkinsop 2025-06-05 12:52:47 UTC
Created attachment 182997 [details] [review]
Bug 40082: Add unit tests

Test plan:
1) Choose an existing patron and note their first and second names as well as their date of birth
2) In the interface, create a new patron and enter all of those details to be the same as your patron from step 1
3) Submit the form, you will get a warning saying that there is a duplicate
4) In the OPAC, self register a new patron using the same details again
5) The form should submit with no error or warning
6) Apply patch, yarn api:bundle and restart_all
7) Repeat steps 2 - 5
8) Step 3 should still have the same behaviour
9) Step 5 should now show a warning at the top to say that there is a duplicate, please contact a member of staff
10) Find the 'PatronDuplicateMatchingAddFields' syspref and select an extra field there, ensuring that your patron from step 1 has data for that field
11) In either the interface or the OPAC, register a new patron but this time change the data of the new field you added in step 10
12) No warning should show for a duplicate patron
13) prove t/db_dependent/api/v1/patrons.t
14) prove t/db_dependent/Koha/Patrons.t