notice fixes, CRM-14782
authorkurund <kurund@civicrm.org>
Sat, 5 Jul 2014 14:50:20 +0000 (20:20 +0530)
committerkurund <kurund@civicrm.org>
Sat, 5 Jul 2014 14:50:20 +0000 (20:20 +0530)
----------------------------------------
* CRM-14782: unable to import 0/no/false values
  https://issues.civicrm.org/jira/browse/CRM-14782

CRM/Contact/Import/Parser/Contact.php

index 2c7448b960aea122689f61bf6132ab93cb9a8dc8..71c0a252d1ec7ec9b4486ee7a138119777ccad32 100644 (file)
@@ -1147,7 +1147,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
           self::addToErrorMsg(ts('field ID'), $errorMessage);
         }
         // validate null values for required custom fields of type boolean
-        if ($customFields[$customFieldID]['is_required'] && (empty($params['custom_'.$customFieldID]) && !is_numeric($params['custom_'.$customFieldID])) && $customFields[$customFieldID]['data_type'] == 'Boolean') {
+        if (!empty($customFields[$customFieldID]['is_required']) && (empty($params['custom_'.$customFieldID]) && !is_numeric($params['custom_'.$customFieldID])) && $customFields[$customFieldID]['data_type'] == 'Boolean') {
           self::addToErrorMsg($customFields[$customFieldID]['label'].'::'.$customFields[$customFieldID]['groupTitle'], $errorMessage);
         }