Skip to content

Commit

Permalink
Fix Fatal error on membership detail report (with ACLs enabled) dev/c…
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed May 8, 2018
1 parent 85b68a1 commit d24a1b8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
16 changes: 0 additions & 16 deletions CRM/Report/Form/Member/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,22 +303,6 @@ public function from() {
}
}

public function postProcess() {

$this->beginPostProcess();

// get the acl clauses built before we assemble the query
$this->buildACLClause($this->_aliases['civicrm_contact']);
$sql = $this->buildQuery(TRUE);

$rows = array();
$this->buildRows($sql, $rows);

$this->formatDisplay($rows);
$this->doTemplateAssignment($rows);
$this->endPostProcess($rows);
}

/**
* Alter display of rows.
*
Expand Down
19 changes: 19 additions & 0 deletions tests/phpunit/api/v3/ReportTemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,25 @@ public function testReportTemplateGetRowsAllReports($reportID) {
));
}

/**
* Tet api to get rows from reports with ACLs enabled.
*
* @dataProvider getReportTemplates
*
* @param $reportID
*
* @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testReportTemplateGetRowsAllReportsACL($reportID) {
if (stristr($reportID, 'has existing issues')) {
$this->markTestIncomplete($reportID);
}
$this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookNoResults'));
$this->callAPISuccess('report_template', 'getrows', array(
'report_id' => $reportID,
));
}

/**
* Test get statistics.
*
Expand Down

0 comments on commit d24a1b8

Please sign in to comment.