From 7ce5cba40e65eec4f7ddae058b45ed2b10b8cb61 Mon Sep 17 00:00:00 2001 From: kurund Date: Wed, 4 Dec 2013 14:03:56 -0800 Subject: [PATCH] CRM-13896, redirect to contact screen is contact is created and action is cancel ---------------------------------------- * CRM-13896: Fatal error on cancel action for new activity after new contact is created http://issues.civicrm.org/jira/browse/CRM-13896 --- CRM/Profile/Form/Edit.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index 2bc5a0865f..b9fba0122b 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -254,10 +254,7 @@ SELECT module if (($this->_multiRecord & CRM_Core_Action::DELETE) && $this->_recordExists) { $this->_deleteButtonName = $this->getButtonName('upload', 'delete'); - $this->addElement('submit', - $this->_deleteButtonName, - ts('Delete') - ); + $this->addElement('submit', $this->_deleteButtonName, ts('Delete')); $buttons[] = array( 'type' => 'cancel', @@ -310,6 +307,11 @@ SELECT module // this is special case when we create contact using Dialog box if ($this->_context == 'dialog') { + //replace the session stack for redirecting user to contact summary if new contact is created. + $contactViewURL = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->_id}", FALSE, NULL, FALSE); + $session = CRM_Core_Session::singleton(); + $session->replaceUserContext($contactViewURL); + $displayName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'display_name'); $sortName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'sort_name'); $returnArray = array( -- 2.25.1