From: yashodha Date: Fri, 26 Oct 2018 06:18:35 +0000 (+0530) Subject: (dev/core#479) Contribution Summary report throw DB error with custom data and soft... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0b0d982165242a241ab40a5ebea5634eb42d67dc;p=civicrm-core.git (dev/core#479) Contribution Summary report throw DB error with custom data and soft credit fields --- diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index 2ef86cd5ce..2fb301915c 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -648,6 +648,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution']}.total_amount), 2) as civicrm if ($softCredit) { $this->from(); + $this->customDataFrom(); $select = " COUNT({$this->_aliases['civicrm_contribution_soft']}.amount ) as civicrm_contribution_soft_soft_amount_count, SUM({$this->_aliases['civicrm_contribution_soft']}.amount ) as civicrm_contribution_soft_soft_amount_sum, @@ -769,6 +770,7 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ $softCredit = (!empty($this->_params['fields']['soft_amount']) && !empty($this->_params['fields']['total_amount'])) ? TRUE : FALSE; if ($softCredit) { $this->from('contribution'); + $this->customDataFrom(); $contriSQL = "{$this->_select} {$this->_from} {$this->_where} {$this->_groupBy} {$this->_having} {$this->_orderBy} {$this->_limit}"; $contriDAO = CRM_Core_DAO::executeQuery($contriSQL); $contriFields = array(