CRM-15940: fix error message for missing report template
authoryashodha <yashodha.chaku@webaccessglobal.com>
Mon, 9 Feb 2015 11:35:14 +0000 (17:05 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Mon, 9 Feb 2015 11:35:14 +0000 (17:05 +0530)
----------------------------------------
* CRM-15940: Report gives white screen rather than sensible error if report instance is invalid
  https://issues.civicrm.org/jira/browse/CRM-15940

CRM/Report/Page/Instance.php

index f9d4fe63cf98c22075a9c3c10fd89626e112dc91..f7e48150445b839236b7589d84efbcbb3b07d091 100644 (file)
@@ -71,8 +71,7 @@ class CRM_Report_Page_Instance extends CRM_Core_Page {
     else {
       $templateInfo = CRM_Core_OptionGroup::getRowValues('report_template', "{$optionVal}", 'value');
       if (empty($templateInfo)) {
-        CRM_Core_Session::setStatus(ts('Could not find template for the instance.'), ts('Template Not Found'), 'error');
-        return;
+        CRM_Core_Error::statusBounce('You have tried to access a report that does not exist.');
       }
 
       $extKey = strpos($templateInfo['name'], '.');