Skip to content

Commit

Permalink
Merge pull request #12151 from eileenmcnaughton/memdetail51
Browse files Browse the repository at this point in the history
Fix Fatal error on membership detail report (with ACLs enabled) dev/core/#100
  • Loading branch information
eileenmcnaughton authored May 16, 2018
2 parents 935ad17 + 2730de4 commit 0291d42
Show file tree
Hide file tree
Showing 2 changed files with 21 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
21 changes: 21 additions & 0 deletions tests/phpunit/api/v3/ReportTemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,27 @@ public function testReportTemplateGetRowsAllReports($reportID) {
));
}

/**
* Test api to get rows from reports with ACLs enabled.
*
* Checking for lack of fatal error at the moment.
*
* @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 0291d42

Please sign in to comment.