From e25c4389e6bf894bfc0b66df2c560bc938134ec4 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Mon, 16 Mar 2015 12:38:13 +0530 Subject: [PATCH] Record not saved on Multi record Profile Create/Edit Mode --- CRM/Core/BAO/CustomField.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 3a57e99bdf..4565fa5b05 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -1586,16 +1586,20 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { //get the custom fields for the entity //subtype and basic type $customDataSubType = NULL; - if (is_array($customFieldExtend)) { + if ($customFieldExtend) { // This is the case when getFieldsForImport() requires fields // of subtype and its parent.CRM-5143 // CRM-16065 - Custom field set data not being saved if contact has more than one contact sub type $customDataSubType = array_intersect(CRM_Contact_BAO_ContactType::subTypes(), (array) $customFieldExtend); if (!empty($customDataSubType) && is_array($customDataSubType)) { - $customFieldExtend = array_unique(array_values(CRM_Contact_BAO_ContactType::getBasicType($customDataSubType))); + $customFieldExtend = CRM_Contact_BAO_ContactType::getBasicType($customDataSubType); + if (is_array($customFieldExtend)) { + $customFieldExtend = array_unique(array_values($customFieldExtend)); + } } } + $customFields = CRM_Core_BAO_CustomField::getFields($customFieldExtend, FALSE, $inline, -- 2.25.1