From: atif-shaikh Date: Tue, 24 Jun 2014 15:08:39 +0000 (+0530) Subject: Additional notice fixes and comments X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7b00a95d6558e3447f295aab7a6b8ba65fa77f24;p=civicrm-core.git Additional notice fixes and comments --- diff --git a/CRM/Contact/Import/Form/MapField.php b/CRM/Contact/Import/Form/MapField.php index f7f0a2adad..20df0d2501 100644 --- a/CRM/Contact/Import/Form/MapField.php +++ b/CRM/Contact/Import/Form/MapField.php @@ -153,7 +153,7 @@ class CRM_Contact_Import_Form_MapField extends CRM_Import_Form_MapField { } } } - + // retrieve and highlight required custom fields $formattedFieldNames = $this->formatCustomFieldName($this->_mapperFields); self::$customFields = CRM_Core_BAO_CustomField::getFields($this->_contactType); foreach(self::$customFields as $key => $attr) { diff --git a/CRM/Contact/Import/Parser/Contact.php b/CRM/Contact/Import/Parser/Contact.php index 184bc25861..ea1bdce838 100644 --- a/CRM/Contact/Import/Parser/Contact.php +++ b/CRM/Contact/Import/Parser/Contact.php @@ -1146,7 +1146,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { if (!array_key_exists($customFieldID, $customFields)) { 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]) && $params['custom_'.$customFieldID] !== 0) && $customFields[$customFieldID]['data_type'] == 'Boolean') { self::addToErrorMsg($customFields[$customFieldID]['label'].'::'.$customFields[$customFieldID]['groupTitle'], $errorMessage); } @@ -1792,7 +1792,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { } } else { - if ($getValue[$cnt]['location_type_id'] == $params[$locKeys][$key]['location_type_id']) { + if ((!empty($getValue[$cnt]['location_type_id']) && !empty($params[$locKeys][$key]['location_type_id'])) && $getValue[$cnt]['location_type_id'] == $params[$locKeys][$key]['location_type_id']) { unset($params[$locKeys][$key]); } } @@ -1875,7 +1875,7 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser { self::formatCustomDate($params, $formatted, $dateType, $key); } elseif ($customFields[$customFieldID]['data_type'] == 'Boolean') { - if (empty($val) && !empty($params['id']) && !is_numeric($val) && $this->_onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { + if (empty($val) && !empty($params['id']) && !is_numeric($val) && $this->_onDuplicate == CRM_Import_Parser::DUPLICATE_FILL) { //retain earlier value when Import mode is `Fill` unset($params[$key]); } else {