Call multiple hook inserts from different modules? Is it possible for two modules that interact with one another to both call hook_insert()?


I have a node type that calls ModuleA_insert() when the user hits the 'save' button.
Module B is a custom comment-like module that gets injected into a form. In module B, I have a ModuleB_insert(), but it never runs.
I am trying to keep module A from having to deal with the inserts/updates from module B.


I can get module B to insert by using hook_nodeapi(), but it would be easier if I could get hook_insert() to work, meaning module A and module B's data and actions are separated from each other - not to mention the overhead cost of having hook_nodeapi() run and check every time.
Rule of thumb: Don't call hook_anything() in other modules. :-)

If you call node_save($yourNode) then the node API will invoke hook_insert() in the module that implements that node type, if the node is being inserted. Otherwise hook_update() gets called for updates.

If you need to act on an insert for any type of node, and it sounds like you do, then you want to implement hook_nodeapi().

Examples has a node project and a nodeAPI project, so you can figure out which you need.