CRM-13404
authoryashodha <yashodha.chaku@webaccess.co.in>
Tue, 17 Sep 2013 14:46:31 +0000 (20:16 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Tue, 17 Sep 2013 14:46:31 +0000 (20:16 +0530)
CRM/Core/BAO/CustomField.php

index 7d67b0d2fd83945113c0681e7bb8de7345a916af..f2ad275a4b1e41152742ae58af3a0050e60c6bb3 100644 (file)
@@ -1555,6 +1555,10 @@ 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)) {
+      $customFieldExtend = $customFieldExtend[0];
+    }
+    
     if (in_array($customFieldExtend,
         CRM_Contact_BAO_ContactType::subTypes()
       )) {
@@ -1585,9 +1589,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
 
     list($tableName, $columnName, $groupID) = self::getTableColumnGroup($customFieldId);
 
-    if (is_array($customFieldExtend)) {
-      $customFieldExtend = $customFieldExtend[0];
-    }
     if (!$customValueId &&
       // we always create new entites for is_multiple unless specified
       !$customFields[$customFieldId]['is_multiple'] &&