From 9cb02ab39889184a9b2ba33f5973c67b1534fd35 Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Wed, 26 Mar 2014 18:06:26 +0530 Subject: [PATCH] CRM-13992-temp_fix : handling the validation message show and redirection improvement --- CRM/Contact/Form/CustomData.php | 5 ++++- templates/CRM/Contact/Form/CustomData.tpl | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/CustomData.php b/CRM/Contact/Form/CustomData.php index c8e9cf4cd1..824694b862 100644 --- a/CRM/Contact/Form/CustomData.php +++ b/CRM/Contact/Form/CustomData.php @@ -132,8 +132,11 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form { $this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this); $this->_tableID = $this->_entityId; $this->_copyValueId = CRM_Utils_Request::retrieve('copyValueId', 'Positive', $this); - $backUrl = CRM_Core_Session::singleton()->readUserContext(); + + $backUrl = 'civicrm/contact/view'; + $backUrl = CRM_Utils_System::url($backUrl, 'action=browse&selectedChild=custom_' . $this->_groupID, TRUE, NULL, FALSE); $this->assign('backUrl', $backUrl); + if (!empty($_POST['hidden_custom'])) { $this->assign('postedInfo', TRUE); } diff --git a/templates/CRM/Contact/Form/CustomData.tpl b/templates/CRM/Contact/Form/CustomData.tpl index 86929ccb00..a5d39f2127 100644 --- a/templates/CRM/Contact/Form/CustomData.tpl +++ b/templates/CRM/Contact/Form/CustomData.tpl @@ -49,6 +49,10 @@ if (!cj(responseText).find('.crm-error').html()) { window.location.href = '{/literal}{$backUrl}{literal}'; } + else { + var errorInfo = cj(responseText).find('div.crm-error').html(); + cj('.crm-container-snippet #CustomData').prepend(errorInfo); + } } {/literal} -- 2.25.1