storing node id of referred node in Autocreate Node Reference module

rulick - November 9, 2009 - 21:07

My question is related to the way Autocreate Node Reference module creates the referred node.

I was wondering if it's possible to store the referred nid somewhere for future use? It's around: function autocreate_field() , right after the call anr_clone_node() is done. I tried:

if ($ref_node->nid){
$node->$field['field_name'][0] = $ref_node->nid;
drupal_set_message(l("edit $ref_node->title", "node/$ref_node->nid/edit"));
}

But it did not help. What am I missing? It could be a simple PHP / Drupal question.

Ideally, I am looking at copying some fields from the original node. In a similar manner as in Node Convert. It could be a great addition to the way the module clones from AC_TEMPLATE.

 
 

Drupal is a registered trademark of Dries Buytaert.