Skip to content
Snippets Groups Projects
Commit 38c3ddcb authored by Seamus Lee's avatar Seamus Lee
Browse files

#2272 Fix a DB error when merging contacts into the same household on...

#2272 Fix a DB error when merging contacts into the same household on contact export and only exporting selected contact fields
parent 68e7edd7
No related branches found
No related tags found
No related merge requests found
......@@ -438,7 +438,11 @@ VALUES $sqlValueString
$relationshipJoin = $relationshipClause = '';
if (!$selectAll && $componentTable) {
$relationshipJoin = " INNER JOIN {$componentTable} ctTable ON ctTable.contact_id = {$contactA}";
$field = 'contact_id';
if ($componentTable === 'civicrm_contact') {
$field = 'id';
}
$relationshipJoin = " INNER JOIN {$componentTable} ctTable ON ctTable.$field = {$contactA}";
}
elseif (!empty($relIDs)) {
$relID = implode(',', $relIDs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment