CRM-14956 - Copying Event Price Set Fails If Any Price Has Active Date
authoratif-shaikh <shaikh388@gmail.com>
Wed, 9 Jul 2014 10:23:18 +0000 (15:53 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Wed, 9 Jul 2014 10:23:18 +0000 (15:53 +0530)
https://issues.civicrm.org/jira/browse/CRM-14956

CRM/Core/DAO.php

index ea88f50dc86237d6aca3889caf89a1cff224c675..001f66b9458ec6b430d6559cf8d7424a014c3c9c 100644 (file)
@@ -1165,6 +1165,7 @@ FROM   civicrm_domain
         }
 
         $dbName = $value['name'];
+        $type = CRM_Utils_Type::typeToString($value['type']);
         $newObject->$dbName = $object->$dbName;
         if (isset($fieldsToPrefix[$dbName])) {
           $newObject->$dbName = $fieldsToPrefix[$dbName] . $newObject->$dbName;
@@ -1176,9 +1177,7 @@ FROM   civicrm_domain
           $newObject->$dbName = $fieldsToReplace[$dbName];
         }
 
-        if (substr($name, -5) == '_date' ||
-          substr($name, -10) == '_date_time'
-        ) {
+        if ($type == 'Timestamp') {
           $newObject->$dbName = CRM_Utils_Date::isoToMysql($newObject->$dbName);
         }