A full description of the bug in the Autocreate Node Reference module can be found here:
http://drupal.org/node/771408
Basically, the Autocreate Node Reference module creates a node, based on a template, whenever a content type with an "autocreate" cck field (which integrates with the cck nodereference module) is created.
Instructions on replicating the problem can be found at the above url.
I believe that the solution is in passing incorrect data to a function that generates the field. When an instance of a content type with the autocreate node reference field is created, the node is gerenated correctly, and viewing the node works as expected (there is a link to the automatically created "child" node visible from the "parent" node).
However, the field table for the parent content type isn't being populated correctly, for some reason.
For instance, if I create a parent content type of "parent_type", and I wish to have a child content (a node reference) of type "page", and call the field 'field_parent_type_page", somewhere along the line, there is a table created called "content_type_parent_page", which contains record of each instance of the type "parent_type", and has column names of "vid", "nid", and "field_page_nid" (the nid of the referenced node).
This works as expected with one major problem - the nid of the referenced node is incorrect. I seem to be populating this field with a value of "5" for EVERY instance, rather than the actual nid of the referenced node. The vid and nid columns correctly indicate the parent node.
My question is:
Where in the code are the records being generated? I would like to put a backtrace in this function, as well as echo the inputted arguments to see what's actually going on and where I can change the data that is being fed into it (most likely within the autocreate module).
Any help?