From e41b14ce6e42a2d5e6afd39fe5cf5a2978dd39a1 Mon Sep 17 00:00:00 2001 From: Deepak Srivastava Date: Tue, 25 Jun 2013 16:57:25 +0530 Subject: [PATCH] CRM-12877, fixed save-a-copy bug ---------------------------------------- * CRM-12877: Provide api for creating report instances http://issues.civicrm.org/jira/browse/CRM-12877 --- CRM/Report/Form/Instance.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index 4152f1ff57..064da4726a 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -245,8 +245,10 @@ class CRM_Report_Form_Instance { $instanceID = $form->getVar('_id'); if ($isNew = $form->getVar('_createNew')) { - // unset $instanceID so a new copy would be created - $instanceID = NULL; + // set the report_id since base template is going to be same, and we going to unset $instanceID + // which will make it difficult later on, to compute report_id + $params['report_id'] = CRM_Report_Utils_Report::getValueFromUrl($instanceID); + $instanceID = NULL; //unset $instanceID so a new copy would be created } $params['instance_id'] = $instanceID; if (CRM_Utils_Array::value('is_navigation', $params)) { -- 2.25.1