From 8158311788c125e2f13ec3f923e63ebc468a6acc Mon Sep 17 00:00:00 2001 From: Brian Shaughnessy <brian@lcdservices.biz> Date: Fri, 20 Dec 2013 16:52:46 -0500 Subject: [PATCH] CRM-14016 remove report instance from nav bar --- CRM/Report/Form/Instance.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index b84cc1068c..aa0edc3577 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -241,7 +241,7 @@ class CRM_Report_Form_Instance { } static function postProcess(&$form, $redirect = TRUE) { - $params = $form->getVar('_params'); + $params = $form->getVar('_params'); $instanceID = $form->getVar('_id'); if ($isNew = $form->getVar('_createNew')) { @@ -254,6 +254,14 @@ class CRM_Report_Form_Instance { if (CRM_Utils_Array::value('is_navigation', $params)) { $params['navigation'] = $form->_navigation; } + else { + //delete navigation if exists + $navId = CRM_Core_DAO::getFieldValue('CRM_Report_DAO_ReportInstance', $instanceID, 'navigation_id', 'id'); + if ($navId) { + CRM_Core_BAO_Navigation::processDelete($navId); + CRM_Core_BAO_Navigation::resetNavigation(); + } + } // make a copy of params $formValues = $params; -- GitLab