Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20739 process groups for import using fill #10507

Merged
merged 1 commit into from
Jun 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CRM/Contact/Import/Parser/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ public function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) {
$this->_retCode = CRM_Import_Parser::VALID;
}
}
elseif (isset($newContact) && CRM_Core_Error::isAPIError($newContact, CRM_Core_ERROR::DUPLICATE_CONTACT)) {
elseif (isset($newContact) && CRM_Core_Error::isAPIError($newContact, CRM_Core_Error::DUPLICATE_CONTACT)) {
// if duplicate, no need of further processing
if ($onDuplicate == CRM_Import_Parser::DUPLICATE_SKIP) {
$errorMessage = "Skipping duplicate record";
Expand All @@ -700,8 +700,10 @@ public function import($onDuplicate, &$values, $doGeocodeAddress = FALSE) {
}

$relationship = TRUE;
# see CRM-10433 - might return comma separate list of all dupes
$dupeContactIDs = explode(',', $newContact['error_message']['params'][0]);
// CRM-10433/CRM-20739 - IDs could be string or array; handle accordingly
if (!is_array($dupeContactIDs = $newContact['error_message']['params'][0])) {
$dupeContactIDs = explode(',', $dupeContactIDs);
}
$dupeCount = count($dupeContactIDs);
$contactID = array_pop($dupeContactIDs);
// check to see if we had more than one duplicate contact id.
Expand Down