Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fatal error on membership detail report (with ACLs enabled) dev/core/#100 #12150

Merged
merged 1 commit into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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