[development] hook_nodeapi()

Rob Barreca rob at electronicinsight.com
Thu Jan 4 01:34:01 UTC 2007

> 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
rob at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070103/a3d9ea9a/attachment.htm 

More information about the development mailing list