import/export cck datetime fields

ddbowen - October 21, 2009 - 21:48
Project:Salesforce
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

We were having a problem with the formatting differences between Salesforce date fields and cck datetime fields. This patch helped us reconcile the differences.

AttachmentSize
sf_node.patch1.55 KB

#1

aaronbauman - November 5, 2009 - 19:12
Status:needs review» needs work

I haven't tried this patch yet.
Looking at the code, however, you have two instances of an undefined / out of scope variable:

+  $data = $source->$field;
+  $return = date($date_format, $unix_timestamp);

+  $data = $node->$key;
+  $formated_date = date($date_format, $unix_timestamp);

Where does $unix_timestamp get defined?
Seems like you're missing a line in between each of those...

Also, taking an example from sf_node_export, I think you can use gmdate(DATE_ATOM, $timestamp); and save about 3 lines.

 
 

Drupal is a registered trademark of Dries Buytaert.