Skip to content
Snippets Groups Projects
Commit d5148d71 authored by eileen's avatar eileen
Browse files

#651 Fix group by on export soft credits (possible recent regression, clearly wrong).

As pointed out by the reporter the group by is being calculated as if it were a string but it's an array, this fixes.

This code has been touched recently so it might be a recent regression. 5.10 is the first release in a long time where
export is working in some mysql / output configs after a big refactor to get rid of wide temp tables
parent 146199c9
Branches
Tags
No related merge requests found
......@@ -124,7 +124,7 @@ class CRM_Export_BAO_Export {
* Group By Clause
*/
public static function getGroupBy($processor, $returnProperties, $query) {
$groupBy = '';
$groupBy = NULL;
$exportMode = $processor->getExportMode();
$queryMode = $processor->getQueryMode();
if (!empty($returnProperties['tags']) || !empty($returnProperties['groups']) ||
......@@ -140,7 +140,7 @@ class CRM_Export_BAO_Export {
$groupBy = 'civicrm_contribution.id';
if (CRM_Contribute_BAO_Query::isSoftCreditOptionEnabled()) {
// especial group by when soft credit columns are included
$groupBy = array('contribution_search_scredit_combined.id', 'contribution_search_scredit_combined.scredit_id');
$groupBy = ['contribution_search_scredit_combined.id', 'contribution_search_scredit_combined.scredit_id'];
}
break;
......@@ -157,7 +157,7 @@ class CRM_Export_BAO_Export {
$groupBy = "civicrm_activity.id ";
}
return $groupBy ? ' GROUP BY ' . $groupBy : '';
return $groupBy ? ' GROUP BY ' . implode(', ', (array) $groupBy) : '';
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment