Core Bugs and Webtest fixes in 4.7beta1
[civicrm-core.git] / CRM / Case / Form / Case.php
index 059fe437c781c1b2c7a524b6aa746f1b189f4257..6d54dbae270d63c3e44f0fb79df27df8f8382589 100644 (file)
@@ -179,15 +179,10 @@ class CRM_Case_Form_Case extends CRM_Core_Form {
     $className::preProcess($this);
     $activityGroupTree = $this->_groupTree;
 
-    if (!$this->_caseTypeId) {
-      $params = CRM_Utils_Request::exportValues();
-      if (isset($params['case_type_id'])) {
-        $this->_caseTypeId = $params['case_type_id'];
-      }
-    }
     // for case custom fields to populate with defaults
     if (!empty($_POST['hidden_custom'])) {
-      CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_caseTypeId, 1, 'Case', $this->_caseId);
+      $params = CRM_Utils_Request::exportValues();
+      CRM_Custom_Form_CustomData::preProcess($this, NULL, CRM_Utils_Array::value('case_type_id', $params, $this->_caseTypeId), 1, 'Case', $this->_caseId);
       CRM_Custom_Form_CustomData::buildQuickForm($this);
     }