Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49197

CCK Date Field with node.save

$
0
0

I've run into a problem with trying to update a CCK date field using the node.save. Here is the node.load so you can see the overall structure of our event node
stdClass Object
(
[nid] => 49
[vid] => 50
[type] => event
[status] => 1
[created] => 1185652917
[changed] => 1185652917
[comment] => 2
[promote] => 0
[sticky] => 0
[revision_timestamp] => 1185652917
[title] => Dang Drupal Date Field
[body] => Testing from Drupal Entry

[teaser] => Testing from Drupal Entry
[log] =>
[format] => 1
[uid] => 1
[name] => whoelse
[picture] =>
[data] => a:0:{}
[last_comment_timestamp] => 1185652917
[last_comment_name] =>
[comment_count] => 0
[taxonomy] => Array
(
)

[files] => Array
(
)

[field_time] => Array
(
[0] => Array
(
[value] => 2007-08-01T01:00:00
[value2] => 2007-08-01T01:50:00
[timezone] => EST
[offset] => 0
)

)

[field_placeid] => Array
(
[0] => Array
(
[value] => 9
)

)

[locations] => Array
(
)

[location] => Array
(
)

[body_value] => Testing from Drupal Entry
)

Now here is some sample Flex 2 code

        var edit:Object = new Object;

        var fromDate:Date = new Date(2007,10,10,5,0,0,0);
        var toDate:Date = new Date(2007,10,10,6,0,0,0);

        edit.type = "event";            
        edit.title = "HELP ME";
        edit.body = "trying to get the event times to save - why doesn't it";

        edit.uid = 2;
        edit.name = "cdurham";

        edit.field_placeid = new Array({value:9});
        edit.field_time = new Array({value:"10/20/2007 - 5:30:00pm", value2:"10/20/2007 - 6:00:00pm", timezone:"EST", offset:0});
        //edit.field_time = new Array();


        edit.locations = new Array();
        edit.location = new Array();

        eventnode.save(edit);

I have no problem saving to the field_placeid, setting the value 9, comment the edit.field_time and uncomment setting it to an empty new Array() I can save the event node fine, without the time. What I am getting back from the date module validation is a return that From Date is not valid, I hacked up the code a bit to spit out the value it's complaining about only to find it seems to be empty. So I am at somewhat of a loss at how I am supposed to pass.

[field_time] => Array
(
[0] => Array
(
[value] => 2007-08-01T01:00:00
[value2] => 2007-08-01T01:50:00
[timezone] => EST
[offset] => 0
)

What is the date module looking for, any ideas


Viewing all articles
Browse latest Browse all 49197

Trending Articles