I have a problem and im looking for help. I wish someone can help me.
I want update a node when someone write another node with the same title. It can seem stupid i know but i need that.
Im used ckk to create a new content type with some simple text fields. To update a node when write another node with the same title i overwrite the hook_form_submit($form_id, $form_values) in a new module. I write this code to get the nid of previus node and put in the array of form_values.
$query = "select nid from {node} where title = '%s'";
$result = db_query($query, $form_values['title']);
$nid = db_fetch_object($result);
$form_values['nid'] = $nid->nid;
node_submit_form($form_id, $form_values) ;
When i call the node_submit_form (last code line) the update runs well with the standard fields of node, but with the cck fields i get duplicate key errors because the cck module try to insert the fields as a new node.
I know is dificult but someone can help me? I want update the cck fields too. If this post must be in another place please say me where.
Thanks all
Best regards.
Comments
Comment #1
karens commentedClosing old issues. None of us is using the D5 version any more, so hard to provide any support. Sorry.