CRM-16990: Custom fields are NOT being saved for some component custom data (activiti...
authoryashodha <yashodha.chaku@webaccessglobal.com>
Mon, 26 Oct 2015 07:00:35 +0000 (12:30 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Tue, 27 Oct 2015 05:38:43 +0000 (11:08 +0530)
----------------------------------------
* CRM-16990: Custom fields are NOT being saved for some component custom data (activities, membership ...)
  https://issues.civicrm.org/jira/browse/CRM-16990

CRM/Case/Form/Case.php
CRM/Member/Form/Membership.php

index 392aaadaf2af3fc06feac22ab2701dc87ef9176d..cdd53b6bb5a64cf3a60aadc0a6e5be1501809918 100644 (file)
@@ -179,6 +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();
+      $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);
index 5618efa6e454bd0fcb39d1b159d35f20d696c753..9f5528b42b85de076d78d442d942312eb498f476 100644 (file)
@@ -242,6 +242,10 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
       }
     }
 
+    if (!$this->_memType) {
+      $params = CRM_Utils_Request::exportValues();
+      $this->_memType = $params['membership_type_id'][1];
+    }
     // when custom data is included in this page
     if (!empty($_POST['hidden_custom'])) {
       CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_memType, 1, 'Membership', $this->_id);