CRM-13992-temp_fix : handling the validation message show and redirection improvement
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Wed, 26 Mar 2014 12:36:26 +0000 (18:06 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Wed, 26 Mar 2014 12:36:26 +0000 (18:06 +0530)
CRM/Contact/Form/CustomData.php
templates/CRM/Contact/Form/CustomData.tpl

index c8e9cf4cd177ed8316e117fc1536a0a7fc354df4..824694b8620490cc75638935fb763f3f9fed25c0 100644 (file)
@@ -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);
         }
index 86929ccb00ceb7a8fb66538106c245c7469f352f..a5d39f21278925500dc20720a8c200eb71ddf05e 100644 (file)
        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);
+       }
      }
      </script>
      {/literal}