From: Pradeep Nayak Date: Wed, 22 Jun 2016 00:36:21 +0000 (+0530) Subject: CRM-18977, modified code to set alias for civicrm_line_item table X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e635ee21813e3117fd5bc09f7ab44207602765e9;p=civicrm-core.git CRM-18977, modified code to set alias for civicrm_line_item table ---------------------------------------- * CRM-18977: Contribution reports fails when Financial ACL is enabled https://issues.civicrm.org/jira/browse/CRM-18977 --- diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 57145563eb..9851120fdb 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -4551,10 +4551,13 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a else { $contFTs = $liFTs = implode(',', array_keys($financialTypes)); } + $temp = CRM_Utils_Array::value('civicrm_line_item', $query->_aliases); if ($alias) { - $temp = CRM_Utils_Array::value('civicrm_line_item', $query->_aliases); $query->_aliases['civicrm_line_item'] = $alias; } + elseif (!$temp) { + $query->_aliases['civicrm_line_item'] = 'civicrm_line_item_civireport'; + } if (empty($query->_where)) { $query->_where = "WHERE {$query->_aliases['civicrm_contribution']}.id IS NOT NULL "; }