foreach ($params as $key => $val) {
if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($key)) {
- if ($val) {
+ if ($key == 'activity_date_time' && $val) {
$params[$key] = CRM_Utils_Date::formatDate($val, $dateType);
}
- elseif ($customFields[$customFieldID]['data_type'] == 'Date') {
+ elseif (!empty($customFields[$customFieldID]) && $customFields[$customFieldID]['data_type'] == 'Date') {
CRM_Contact_Import_Parser_Contact::formatCustomDate($params, $params, $dateType, $key);
}
- elseif ($customFields[$customFieldID]['data_type'] == 'Boolean') {
+ elseif (!empty($customFields[$customFieldID]) && $customFields[$customFieldID]['data_type'] == 'Boolean') {
$params[$key] = CRM_Utils_String::strtoboolstr($val);
}
}