Dedupe ignores Phone-Work-Mobile field
CRM_Dedupe_Finder uses a dedupe rule to find contacts who match the supplied fields (eg, when registering participants). This failed in the case when one of the supplied fields was a Phone.
This occurs when you register for an event where ...
The dedupe rule includes a Phone to get a match
The fields on the register page include a Phone that is not Primary (eg Work Mobile)
The registration data should match an existing contact if the phone number is used in the dedupe rule
However, a new contact is created.
What is required is to modify CRM_Dedupe_Finder::formatParams() to support dedupe rules that include non-Primary 'phone' fields. This was being blocked because profile fields named 'phone-N-N' were not being recognised as 'phone' fields. The regex that parses the field name recognised 'phone-Primary' and 'phone-Primary-2' and 'phone-2' as 'phone' fields. I extended the regex to recognise 'phone-6-2' as a 'phone' field.