Ejegg has submitted this change and it was merged. Change subject: Make compatible with raw SQL instrumentation ......................................................................
Make compatible with raw SQL instrumentation Store the intermediate SQL query in our standard member variable, so it can be displayed in the GUI. Change-Id: I2a003b7190515c3ca99b618fab35111f4ce21c0e --- M CRM/Report/Form/Contribute/Lybunt.php 1 file changed, 7 insertions(+), 5 deletions(-) Approvals: Ejegg: Looks good to me, approved diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index b122b29..af69554 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -37,6 +37,8 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { + protected $sql; + protected $_charts = array( '' => 'Tabular', 'barChart' => 'Bar Chart', @@ -326,9 +328,9 @@ $rows = $contactIds = array(); if (!CRM_Utils_Array::value('charts', $this->_params)) { $this->limit(); - $getContacts = "SELECT SQL_CALC_FOUND_ROWS {$this->_aliases['civicrm_contact']}.id as cid {$this->_from} {$this->_where} GROUP BY {$this->_aliases['civicrm_contact']}.id {$this->_limit}"; + $this->sql = "SELECT SQL_CALC_FOUND_ROWS {$this->_aliases['civicrm_contact']}.id as cid {$this->_from} {$this->_where} GROUP BY {$this->_aliases['civicrm_contact']}.id {$this->_limit}"; - $dao = CRM_Core_DAO::executeQuery($getContacts); + $dao = CRM_Core_DAO::executeQuery($this->sql); while ($dao->fetch()) { $contactIds[] = $dao->cid; @@ -339,13 +341,13 @@ if (!empty($contactIds) || CRM_Utils_Array::value('charts', $this->_params)) { if (CRM_Utils_Array::value('charts', $this->_params)) { - $sql = "{$this->_select} {$this->_from} {$this->_where} {$this->_groupBy}"; + $this->sql = "{$this->_select} {$this->_from} {$this->_where} {$this->_groupBy}"; } else { - $sql = "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" . implode(',', $contactIds) . ") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} "; + $this->sql = "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" . implode(',', $contactIds) . ") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} "; } - $dao = CRM_Core_DAO::executeQuery($sql); + $dao = CRM_Core_DAO::executeQuery($this->sql); $current_year = $this->_params['yid_value']; $previous_year = $current_year - 1; -- To view, visit https://gerrit.wikimedia.org/r/171980 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a003b7190515c3ca99b618fab35111f4ce21c0e Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm/civicrm Gerrit-Branch: master Gerrit-Owner: Awight <awi...@wikimedia.org> Gerrit-Reviewer: Awight <awi...@wikimedia.org> Gerrit-Reviewer: Ejegg <eeggles...@wikimedia.org> Gerrit-Reviewer: Katie Horn <kh...@wikimedia.org> Gerrit-Reviewer: Ssmith <ssm...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits