Fix for CRM-15458
authorRohan Katkar <rohan.katkar@webaccessglobal.com>
Fri, 17 Oct 2014 05:33:25 +0000 (11:03 +0530)
committerRohan Katkar <rohan.katkar@webaccessglobal.com>
Fri, 17 Oct 2014 05:33:25 +0000 (11:03 +0530)
CRM/Activity/Import/Parser/Activity.php

index 1d5a7d6e0aa06187cf1ce60a80afec595a7576af..bca07b0f93b3c4b8bad7b2abe04cbfdd9b1abcac 100644 (file)
@@ -265,13 +265,13 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
 
     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);
         }
       }