From f45db615b80f44b71fdf06573f57eef44c8de493 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 20 Jan 2016 10:32:15 +1300 Subject: [PATCH] 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 --- CRM/Report/Form.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- 2.25.1