CRM-16990 -- Custom fields are NOT being saved for some component custom data (activi...
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 20 Oct 2015 09:17:08 +0000 (14:47 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 20 Oct 2015 09:17:08 +0000 (14:47 +0530)
CRM/Activity/Form/Activity.php
CRM/Campaign/Form/Campaign.php
CRM/Grant/Form/Grant.php
CRM/Member/Form/Membership.php

index 908f7cef64571dd67f6a510b90725e474343cca1..bbfaa1be1195bd6b50da5d0d7ed9f75542334ed5 100644 (file)
@@ -469,7 +469,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
       $this->set('type', 'Activity');
       $this->set('subType', $this->_activityTypeId);
       $this->set('entityId', $this->_activityId);
-      CRM_Custom_Form_CustomData::preProcess($this);
+      CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_activityTypeId, 1, 'Activity', $this->_activityId);
       CRM_Custom_Form_CustomData::buildQuickForm($this);
       CRM_Custom_Form_CustomData::setDefaultValues($this);
     }
index c9eaaf7076d392f63df9b8a3ffda5df4e17617a7..5511f1985ef19f95d8f99e354a64292304786283 100644 (file)
@@ -115,11 +115,12 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form {
 
     // when custom data is included in form.
     if (!empty($_POST['hidden_custom'])) {
+      $campaignTypeId = empty($_POST['campaign_type_id']) ? NULL : $_POST['campaign_type_id'];
       $this->set('type', 'Campaign');
-      $this->set('subType', CRM_Utils_Array::value('campaign_type_id', $_POST));
+      $this->set('subType', $campaignTypeId);
       $this->set('entityId', $this->_campaignId);
 
-      CRM_Custom_Form_CustomData::preProcess($this);
+      CRM_Custom_Form_CustomData::preProcess($this, NULL, $campaignTypeId, 1, 'Campaign', $this->_campaignId);
       CRM_Custom_Form_CustomData::buildQuickForm($this);
       CRM_Custom_Form_CustomData::setDefaultValues($this);
     }
index 5b05b5d053495326a41cb7c5fc5df9d085bf8234..bb43dd433f17ac93e0eb6001df42621c2c6188d7 100644 (file)
@@ -103,10 +103,11 @@ class CRM_Grant_Form_Grant extends CRM_Core_Form {
 
     // when custom data is included in this page
     if (!empty($_POST['hidden_custom'])) {
+      $grantTypeId = empty($_POST['grant_type_id']) ? NULL : $_POST['grant_type_id'];
       $this->set('type', 'Grant');
-      $this->set('subType', CRM_Utils_Array::value('grant_type_id', $_POST));
+      $this->set('subType', $grantTypeId);
       $this->set('entityId', $this->_id);
-      CRM_Custom_Form_CustomData::preProcess($this);
+      CRM_Custom_Form_CustomData::preProcess($this, NULL, $grantTypeId, 1, 'Grant', $this->_id);
       CRM_Custom_Form_CustomData::buildQuickForm($this);
       CRM_Custom_Form_CustomData::setDefaultValues($this);
     }
index fedfa1e9eb13d10fcadadfe0c8760596ccbf0845..5618efa6e454bd0fcb39d1b159d35f20d696c753 100644 (file)
@@ -244,7 +244,7 @@ class CRM_Member_Form_Membership extends CRM_Member_Form {
 
     // when custom data is included in this page
     if (!empty($_POST['hidden_custom'])) {
-      CRM_Custom_Form_CustomData::preProcess($this);
+      CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_memType, 1, 'Membership', $this->_id);
       CRM_Custom_Form_CustomData::buildQuickForm($this);
       CRM_Custom_Form_CustomData::setDefaultValues($this);
     }