Moreover, if event module is pointing to CCK, then who owns the node type? CCK or event? In content module you have all the content_insert, content_load, content_*, so it looks like content.module owns those types and defines those node hooks (and funky load callbacks). :-)
Rob Roy Barreca Founder and COO Electronic Insight Corporation http://www.electronicinsight.com rob@electronicinsight.com Khalid B wrote:
Suggestion 4 is interesting, and seems to be a viable solution too.
The biggest disadvantage of this (which is quite obvious from looking at the above example) is that it will be difficult to say when a module should or shouldn't assume ownership of node types, and that it will be easy for multiple modules to all assume ownership of node types, which would basically render the ordering of the hooks redundant (since none of them choose to use 'alter').
Agreed.
Moreover, if event module is pointing to CCK, then who owns the node type? CCK or event?
Suggestion 5 builds on what Karoly said, which I am summarizing below.
- move all hook_load() and friends into hook_othernodeapi($op), where $op is load, insert, delete, ...etc. - So, we have one real hook (hook_nodeapi($op)), and one callback (hook_othernodeapi($op)).
(of course, othernodeapi has to be something better)
This has the advantage of having only a maximum of two functions per module, with ops of course. One for node creation modules, and the other the regular nodeapi we know today.
Your suggestion (#4) has the advantage of collapsing everything in one hook_nodeapi() though.