Report test fix
authoreileen <emcnaughton@wikimedia.org>
Mon, 6 Jun 2016 14:45:05 +0000 (08:45 -0600)
committereileen <emcnaughton@wikimedia.org>
Tue, 7 Jun 2016 17:17:36 +0000 (11:17 -0600)
CRM/Report/Form.php

index 3c519aa7276be4ec7ff5149d428e1e9a79232d87..5a5554e73e68d3bc42ac6ff272f5a6593c331c0a 100644 (file)
@@ -625,8 +625,9 @@ class CRM_Report_Form extends CRM_Core_Form {
     }
 
     // Special permissions check for private instance if it's not the current contact instance
-    if (CRM_Report_BAO_ReportInstance::reportIsPrivate($this->_id) &&
-      !CRM_Report_BAO_ReportInstance::contactIsOwner($this->_id)) {
+    if (!$this->_id ||
+      (CRM_Report_BAO_ReportInstance::reportIsPrivate($this->_id) &&
+      !CRM_Report_BAO_ReportInstance::contactIsOwner($this->_id))) {
       if (!CRM_Core_Permission::check('access all private reports')) {
         $this->_instanceForm = FALSE;
         $this->assign('criteriaForm', FALSE);