https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43831

--- Comment #1 from Andrii Nugged <[email protected]> ---
Created attachment 208231
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208231&action=edit
Bug 43831: Do not match patrons blank in every compared duplicate field

Since bug 42018, a field that is blank in an existing patron record no
longer prevents that record from being reported as a possible
duplicate. Every compared field is checked as "same value, or blank in
the existing record".

As a side effect, an existing patron that is blank in every compared
field now matches every new patron. With the default
PatronDuplicateMatchingAddFields value (surname|firstname|dateofbirth),
a single record without surname, first name and date of birth (for
example an account created only with a card number or a user name)
makes every staff "New patron" save, every OPAC self registration and
every POST /api/v1/patrons request report that record as a duplicate
(the API answers 409 unless x-confirm-not-duplicate is sent).

This patch keeps the bug 42018 behaviour for partially blank records,
but additionally requires that at least one of the fields compared in
the request holds the same value in the existing record. A record that
is blank in all of them is no longer a duplicate of anyone.

Unchanged: an empty PatronDuplicateMatchingAddFields, or data with no
value in any configured field, still finds no duplicate (bug 43069),
and '0' is still compared as a value.

Test plan:
Before applying the patch:
1. Go to Administration > System preferences and search for
   BorrowerMandatoryField.
2. Remove "surname" from the value (keep "cardnumber") and click Save.
3. Search for PatronDuplicateMatchingAddFields and make sure it is
   "surname|firstname|dateofbirth". Click Save if you changed it.
4. Go to Patrons and click New patron, then choose the category
   "Patron" (or any adult category without age limits).
5. Leave Surname, First name and Date of birth empty, fill in Card
   number and Library, and click Save.
6. Note the new patron is saved.
7. Go to Patrons and click New patron, then choose the category
   "Patron" (or any adult category without age limits).
8. Fill in Surname "Doe", First name "Jane", Date of birth 05/05/1990
   (enter it in your date format), a Card number and a Library, and
   click Save.
9. Note the page shows "Duplicate patron record?" and offers the patron
   from step 5 as the existing record.

Apply the patch.

After applying the patch:
1. Repeat steps 7-8 with a different Card number.
2. Note the patron is saved without the "Duplicate patron record?"
   message.
3. Go to Patrons and click New patron, then choose the category
   "Patron" (or any adult category without age limits).
4. Fill in the same Surname, First name and Date of birth as in step 1,
   a new Card number and a Library, and click Save.
5. Note the page shows "Duplicate patron record?" and offers the patron
   saved in step 1: real duplicates are still found.
6. Restore BorrowerMandatoryField to its original value.

Co-Authored-By: Loontik <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to