From 0c8a95de26a0194408d418367798eac5c198ee65 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 22 Jun 2016 06:06:21 +0530 Subject: [PATCH] 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 --- CRM/Report/Form.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 "; } -- 2.25.1