I am wrtitting one drupal custom module in which i have to create node based on custom values. Here is code which creates node in proper manner.
global $user; $node = new stdClass(); $node->type = 'my_node_type'; //$node->title = $nodeInfo->title; node_object_prepare($node); $node->language = LANGUAGE_NONE; $node->uid = $user->uid; $node->field_node_refrence_field['und']['nid'] = $nid-of-reference-field; $node = node_submit($node); node_save($node);
BUT, i have auto_nodetitle module enabled for this content type. Due to that, Title is displaying as blank. I have checked module file and found that there is function of "auto_nodetitle_set_title($node)" to set title, but when i used this function in my code nothing happens.
Can anyone give me idea how to save node with auto_nodetitle settings in custom module?