Check for matching contact on contact add form sends hardcoded fields to duplicatecheck api call
Overview
If a custom Supervised rule is created using any field not in ['first_name', 'last_name', 'nick_name', 'household_name', 'organization_name', 'email'] then clicking on the Check for Matching Contact button will return no results.
Reproduction steps
- Click on Contacts -> Find and Merge Duplicate Contacts.
- Click on Add Individual Rule
- Add a rule with field phone, weight 10, threshold 10
- Click on Change rule and set to Supervised
- Click on Contacts -> New Individual
- Add a contact with First Name: Bob, Last Name: Dobbs and phone 666.666.6666
- Save the contact.
- Click on Contacts -> New Individual
- Add a contact with First Name: Bob, Last Name: Dobbs and phone 666.666.6666
- Click on Check for Matching Contact
Current behaviour
A popup displays "Similar contact if found" after entering the First Name and after entering the Last Name in step 9.
After entering the duplicate phone number nothing happens.
After clicking on Check for Matching Contact nothing happens.
Expected behavior
After entering either First Name or Last Name nothing should happen unless the entered field is included in the Supervised rule.
A popup displaying "Similar contact if found" should happen after the phone number is entered and also after clicking on Check for Matching Contact
Comments
I ran across this while looking to see if I could fix any other outstanding bugs related dedupe. Was working on this one: (#2966) I wasn't able to reproduce their issue.
It may still be useful to hard code those fields so by default the form always matches on name or email when entering those fields but then the additional fields will also be searched when added using the custom rule. As any fields not needed for the custom rule will just be ignored.