Closed jensschuppe closed 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.
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.
@jensschuppe Please create a new feature ticket, as discussed
Steps to reproduce
Contact.getorcreate
with only the contact ID and some address data as parameters - i.e. no data that would result in a contact match using XCM's matching rulesExpected 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 awithout 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.