CRM-16625 fix formatting of dates to be passed to contact creation during import
authorDavid Knoll <david@futurefirst.org.uk>
Thu, 4 Jun 2015 12:37:12 +0000 (13:37 +0100)
committerDavid Knoll <david@futurefirst.org.uk>
Thu, 4 Jun 2015 12:37:12 +0000 (13:37 +0100)
CRM/Contact/Import/Parser/Contact.php

index f546dd166fdfc38ae6182a364d7aaf19cb54c136..d1785ed72b336c4dcee4520dc267d720d9a1f448 100644 (file)
@@ -1878,20 +1878,20 @@ class CRM_Contact_Import_Parser_Contact extends CRM_Contact_Import_Parser {
             $params[$key] = CRM_Utils_String::strtoboolstr($val);
           }
         }
+      }
 
-        if ($key == 'birth_date' && $val) {
-          CRM_Utils_Date::convertToDefaultDate($params, $dateType, $key);
-        }
-        elseif ($key == 'deceased_date' && $val) {
-          CRM_Utils_Date::convertToDefaultDate($params, $dateType, $key);
-        }
-        elseif ($key == 'is_deceased' && $val) {
-          $params[$key] = CRM_Utils_String::strtoboolstr($val);
-        }
-        elseif ($key == 'gender') {
-          //CRM-4360
-          $params[$key] = $this->checkGender($val);
-        }
+      if ($key == 'birth_date' && $val) {
+        CRM_Utils_Date::convertToDefaultDate($params, $dateType, $key);
+      }
+      elseif ($key == 'deceased_date' && $val) {
+        CRM_Utils_Date::convertToDefaultDate($params, $dateType, $key);
+      }
+      elseif ($key == 'is_deceased' && $val) {
+        $params[$key] = CRM_Utils_String::strtoboolstr($val);
+      }
+      elseif ($key == 'gender') {
+        //CRM-4360
+        $params[$key] = $this->checkGender($val);
       }
     }