node_save does not save body content I'm trying to create a node using PHP. The below code works fine until I use any language code other than 'LANGUAGE_NONE'.

$node = new stdClass();
$node-&gt;type = 'recipe';
node_object_prepare($node);
$node-&gt;uid = 1;
$node-&gt;language = LANGUAGE_NONE;
$node-&gt;title = $item['title'];
$node-&gt;body[$node-&gt;language][0]['value']= $item['description'];
$node-&gt;body[$node-&gt;language][0]['format']= 'plain_text';      
node_save($node);


If I use "en" instead of "LANGUAGE_NONE" then the node is created without any field being populated. That is, there is only a title; the body is blank.

Locale module is enabled and i18n is installed and enabled.

What should I do?
You also need to set the language of the fields.

$node-&gt;language = 'en';
$field_langcode = field_language('node', $node, 'body');
$node-&gt;body[$field_langcode][0]['value']   = $body_text;
$node-&gt;body[$field_langcode][0]['summary'] = text_summary($body_text);
$node-&gt;body[$field_langcode][0]['format']  = filter_default_format();


See this comment (https://drupal.org/comment/5464106#comment-5464106) for more info.