systopia / de.systopia.xcm

CiviCRM Extended Contact Matcher
Other
5 stars 10 forks source link

Additional address created when contact matched via contact ID #35

Closed jensschuppe closed 5 years ago

jensschuppe commented 5 years ago

Steps to reproduce

Expected result

Actual result

Technical background

Since the contact is not being matched using XCM's rules, CRM_Xcm_MatchingEngine::createContact() is being called, which issues a

civicrm_api3('Address', 'create', $address_data);

without checking for existing addresses or any XCM settings at all.

Proposed resolution

Instead of falling back to CRM_Xcm_MatchingEngine::createContact(), CRM_Xcm_MatchingEngine::matchContact() should always try to match the contact by contact ID if it was given.

Alternatively, some logic like in CRM_Xcm_MatchingEngine::addDetailToContact() could be implemented for address records.

bjendres commented 5 years ago

Calling the xcm with a contact ID is not in the scope of this extension. From my point of view, the system should strip an id parameter if given, or return an API error.

Processing the contact as you described would be a completely new feature.

jensschuppe commented 5 years ago

Planned implementation after discussing with @systopia:

Implement a configuration switch: accept contact ID as parameter or not

Pay attention to feature parity with a contact ID matching rule.

Finding merged contacts (using ID tracker) will be a sub-feature to consider.

bjendres commented 5 years ago

@jensschuppe Please create a new feature ticket, as discussed