Skip to content

Commit

Permalink
Merge branch 'hotfix' of github.com:NETivism/netiCRM into hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Oct 15, 2024
2 parents 7647014 + 8f09975 commit 40a0ce9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -3939,7 +3939,12 @@ static function apiQuery($params = NULL,
$sql = "$select $from $where $having";
// add group by
if ($query->_useGroupBy || $groupBy) {
$sql .= ' GROUP BY contact_a.id';
if (isset($query->_groupByComponentClause) && !empty($query->_groupByComponentClause)) {
$sql .= $query->_groupByComponentClause;
}
else {
$sql .= ' GROUP BY contact_a.id';
}
}
if (!empty($sort)) {
$sql .= " ORDER BY $sort ";
Expand Down
3 changes: 1 addition & 2 deletions api/v3/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,9 @@ function civicrm_api3_contribution_get($params) {
$mode = CRM_Contact_BAO_Query::MODE_CONTRIBUTE;
$additionalOptions = _civicrm_api3_get_options_from_params($params, TRUE);
$returnProperties = CRM_Contribute_BAO_Query::defaultReturnProperties($mode);
$groupBy = 'civicrm_contribution.id';

// Get the contributions based on parameters passed in
$contributions = _civicrm_api3_get_using_query_object('Contribution', $params, $additionalOptions, NULL, $mode, $returnProperties, $groupBy);
$contributions = _civicrm_api3_get_using_query_object('Contribution', $params, $additionalOptions, NULL, $mode, $returnProperties, TRUE);
if (!empty($contributions)) {
foreach ($contributions as $id => $contribution) {
$soft_params = array('contribution_id' => $id);
Expand Down

0 comments on commit 40a0ce9

Please sign in to comment.