From 69dde52d22239059e1af3988463a7f837f3d9dbd Mon Sep 17 00:00:00 2001 From: Web Access Date: Fri, 17 Apr 2015 19:44:21 +0530 Subject: [PATCH] Fix for CRM-16301 --- CRM/Contact/Form/Contact.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 6833f8567c..7a8596a6b5 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -1037,8 +1037,9 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { // here we replace the user context with the url to view this contact $buttonName = $this->controller->getButtonName(); if ($buttonName == $this->getButtonName('upload', 'new')) { + $contactSubTypes = array_filter(explode(CRM_Core_DAO::VALUE_SEPARATOR, $this->_contactSubType)); $resetStr = "reset=1&ct={$contact->contact_type}"; - $resetStr .= $this->_contactSubType ? "&cst={$this->_contactSubType}" : ''; + $resetStr .= (count($contactSubTypes) == 1) ? "&cst=" . array_pop($contactSubTypes) : ''; $session->replaceUserContext(CRM_Utils_System::url('civicrm/contact/add', $resetStr)); } else { -- 2.25.1