I have a collection of nodes that are created programmatically after having created the content type using Drupal. This is the creation code:
$node = new stdClass();
$node->title = $vals->title;
$node->type = "event_type";
node_object_prepare($node);
$node->status = 1;
$node->promote = 0;
$node->comment = 0;
// title
$node->title = $vals->title;
// body
$node->body[$node->language][0]['value'] = $vals->body;
$node->body[$node->language][0]['summary'] = text_summary($vals->body);
$node->body[$node->language][0]['format'] = 'filtered_html';
// intro text
$node->field_event_type_intro = $vals->field_event_type_intro;
// teaser
$node->teaser = $vals->teaser;
// data
$node->data = $vals->data;
// nodewords
$node->nodewords = $vals->nodewords;
$node = node_submit($node); // Prepare node for saving
node_save($node);
This seems to be working but when I then click on one of these nodes to edit it it only shows the title in the edit screen. The body and intro are missing.
What am I doing wrong?