$orderByRef = "activity_assignment_civireport.contact_id";
if (in_array($fieldName, array(
'contact_target', 'target_contact_id'))) {
- $orderByRef = "activity_target_civireport.target_contact_id";
+ $orderByRef = "activity_target_civireport.contact_id";
}
$select[] = "GROUP_CONCAT(DISTINCT {$field['dbAlias']} ORDER BY {$orderByRef} SEPARATOR '{$seperator}') as {$tableName}_{$fieldName}";
}
) {
$this->_from .= "
LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']}
- ON ({$this->_aliases['civicrm_activity_target']}.target_contact_id =
+ ON ({$this->_aliases['civicrm_activity_target']}.contact_id =
{$this->_aliases['civicrm_address']}.contact_id) AND
{$this->_aliases['civicrm_address']}.is_primary = 1\n";
}