The monolithic hook_nodeapi meant you had an overview of what happened to a node.
This is now lost; furthermore because the new hooks are just hook_node_op and not hook_nodeapi_op, they are mixed up with lots of other hook_node_THING.
I would suggest we need:
- an @ingroup for the hooks that are node operations, as opposed to things like hook_node_info, say -- things that happen when a node is viewed, edited, and deleted.
- maybe a documentation page to explain a node's lifecycle now it's not as easily graspable from the hook_nodeapi docs.
Comments
Comment #1
jhodgdonI like the idea of two @ingroups actually. One group would be for the type-specific hooks (the ones that are only called on the node type's base name), and the other would be for the hooks that used to be in hook_nodeapi (the ones that are invoked on all modules).
And I like the idea of the group headers explaining the sequence of operations in the life cycle of a node (which hooks are called in which order). Probably one of the two @ingroups could explain that sequence, and maybe the other one could reference... or maybe it should be one group?
Comment #2
joachim commentedTwo groups sounds best to me. And I would put it on the ex-nodeapi hooks, as I think by far those are the most common in use.
Comment #3
jhodgdonOK, I'll take a stab at it.
Comment #4
jhodgdonI'm working on this. I actually think I'll just put them all in one group, because there will be only one description.
Comment #5
jhodgdonOK, here's a patch...
Comment #6
joachim commentedWow.
Brilliant :D
I like this bit especially!
Not tested as a patch, but if the bot says it's ok that's good enough for me. Setting to RTBC.
This review is powered by Dreditor.
Comment #7
dries commentedAwesome. Committed to CVS HEAD. Thanks jhodgdon -- keep rocking it!
Comment #8
jhodgdonTaking another look at the result http://api.drupal.org/api/group/node_api_hooks/7 I see a few minor problems. Update patch attached.
- There's no blog_insert() function, so changed example to "poll" in the intro section.
- Forgot the (all) designation on a hook or two
- taxonomy_node_update_index() does not exist. I'm filing a separate issue on that, since it shouldn't be invoked from node_search_execute().
Comment #9
jhodgdonHere's the issue link on removing the call to taxonomy_node_update_index().
#710406: node_search_execute should not try to call taxonomy_node_update_index()
Comment #10
dries commentedCommitted the patch in #8. Thanks.