Dear Forum members,
I am trying to write a new module that will capture the insertion, update, and delete of a node and make the appropriate insertion, update, or delete of content on another non-Drupal remote system. What I am looking for is somewhere I can add an action using hook_action_info_alter() in my new module that would pass me the new node *after* it has been inserted into the database / displayed on the site.
What has me puzzled is that, in node.module in the function node_action_info(), there is under node_publish_action
'hooks' => array(
'nodeapi' => array('presave'),
'comment' => array('insert', 'update'),
),
There doesn't seem to be a hook for an "insert" or "update" for the node, except for "presave", which happens before the insert or update. If I were to add my own custom action to this list, would I do something to modify this structure (within my own implementation of hook_action_info_alter()) such that it would look like this in a var_dump:
'hooks' => array(
'nodeapi' => array('presave'),
'comment' => array('insert', 'update'),
'my_module_name' => array('insert','update'),
),
And then I could expect that the $node I want will be passed to my own implementation of insert and update in my own module?
I shall be obliged.