From: eileen Date: Tue, 19 Jan 2016 21:32:15 +0000 (+1300) Subject: CRM-17837 Report class pager function, test/ api access fix. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f45db615b80f44b71fdf06573f57eef44c8de493;p=civicrm-core.git CRM-17837 Report class pager function, test/ api access fix. This minor patch just checks if the get function is callable before calling it. It allows the api calls to not fatal. The api calls are primarily used in the unit tests at this stage although the original intent was about more flexible charting by retrieving the data from an api & passing it to 'any' charting library Change-Id: I8b3e4e9ade3f75ce8bc6e608cb3c7c6e60d127b9 --- diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 93b813de40..9426e0f9ba 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -3305,8 +3305,12 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND 'status' => ts('Records') . ' %%StatusMessage%%', 'buttonBottom' => 'PagerBottomButton', 'buttonTop' => 'PagerTopButton', - 'pageID' => $this->get(CRM_Utils_Pager::PAGE_ID), ); + if (!empty($this->controller)) { + // This happens when being called from the api Really we want the api to be able to + // pass paging parameters, but at this stage just preventing test crashes. + $params['pageID'] = $this->get(CRM_Utils_Pager::PAGE_ID); + } $pager = new CRM_Utils_Pager($params); $this->assign_by_ref('pager', $pager);