From 21e9acd9096cfd0161ab0276259da81b4c433458 Mon Sep 17 00:00:00 2001
From: Edsel <edsel.lopez@jmaconsulting.biz>
Date: Tue, 19 Aug 2014 17:36:42 +0530
Subject: [PATCH] CRM-14795 Modified code to handle custom grant fields

---
 CRM/Grant/Form/Task/Batch.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CRM/Grant/Form/Task/Batch.php b/CRM/Grant/Form/Task/Batch.php
index 3c17e44..6ad0402 100644
--- a/CRM/Grant/Form/Task/Batch.php
+++ b/CRM/Grant/Form/Task/Batch.php
@@ -209,6 +209,8 @@ class CRM_Grant_Form_Task_Batch extends CRM_Grant_Form_Task {
     if (isset($params['field'])) {
       foreach ($params['field'] as $key => $value) {
 
+        CRM_Contact_BAO_Contact::createProfileContact($value, $this->_fields, $this->_contactDetails[$key]['contact_id']);
+
         $value['custom'] = CRM_Core_BAO_CustomField::postProcess($value,
           CRM_Core_DAO::$_nullObject,
           $key,
@@ -238,7 +240,6 @@ class CRM_Grant_Form_Task_Batch extends CRM_Grant_Form_Task {
         
         $grant = CRM_Grant_BAO_Grant::add($value, $ids);
         
-        CRM_Contact_BAO_Contact::createProfileContact($value, $this->_fields, $this->_contactDetails[$key]['contact_id']);
         // add custom field values
         if (!empty($value['custom']) &&
           is_array($value['custom'])
-- 
GitLab