Maybe I am missing something, but as far as I can tell there is no way to get the new clone nid from the existing hook.
Please add the ability to get the cloned node id.

This patch adds module_invoke_all('clone_node_saved',$node, $original_node); in the clone_node_save function immediately after node save.

This only works for the clone / edit method not the form clone method obviously.
But this does allow easily cloning uc_attributes and other problamatic cck stuff.

If there is an easier way to get the cloned nid whithout this patch please let me know.

Comments

pwolanin’s picture

I think this will work:

implement hook_clone_node_alter()

Set some distinctive property on the new $node your module can watch for on hook_nodeapi()

Implement hook_nodeapi and watch the insert op - if the node has the property set, you can act.

pwolanin’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new834 bytes

Actually adding such a flag in this module is trivial and might be useful - see if this works for you.

pwolanin’s picture

pwolanin’s picture

Status: Needs review » Closed (duplicate)