From edb1d052875ce442e7a1c10d563e375fd406436b Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 23 Aug 2014 11:25:09 +1200 Subject: [PATCH] CRM-15168 test fix for bug highlighted by this issue --- CRM/Report/BAO/ReportInstance.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php index fd1f3e12a6..ff147eec67 100644 --- a/CRM/Report/BAO/ReportInstance.php +++ b/CRM/Report/BAO/ReportInstance.php @@ -54,8 +54,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { return NULL; } - $config = CRM_Core_Config::singleton(); - $params['domain_id'] = CRM_Core_Config::domainID(); + $instanceID = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('instance_id', $params)); // convert roles array to string if (isset($params['grouprole']) && is_array($params['grouprole'])) { @@ -68,13 +67,9 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { ); } - if (!isset($params['id'])) { + if (!$instanceID) { $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE); - } - - $instanceID = CRM_Utils_Array::value('id', $params); - if (!empty($params['instance_id'])) { - $instanceID = CRM_Utils_Array::value('instance_id', $params); + $params['domain_id'] = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID()); } if ($instanceID) { @@ -87,7 +82,7 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { $instance = new CRM_Report_DAO_ReportInstance(); $instance->copyValues($params); - if ($config->userFramework == 'Joomla') { + if (CRM_Core_Config::singleton()->userFramework == 'Joomla') { $instance->permission = 'null'; } -- 2.25.1