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.

CommentFileSizeAuthor
#8 708974fixup.patch3.06 KBjhodgdon
#5 708974.patch11.65 KBjhodgdon

Comments

jhodgdon’s picture

I 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?

joachim’s picture

Two 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.

jhodgdon’s picture

OK, I'll take a stab at it.

jhodgdon’s picture

Assigned: Unassigned » jhodgdon

I'm working on this. I actually think I'll just put them all in one group, because there will be only one description.

jhodgdon’s picture

Assigned: jhodgdon » Unassigned
Status: Active » Needs review
StatusFileSize
new11.65 KB

OK, here's a patch...

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Wow.

Brilliant :D

+++ modules/node/node.api.php	9 Feb 2010 19:26:59 -0000
@@ -7,6 +7,119 @@
+ * - Viewing a single node (calling node_view() - note that the input to
+ *   node_view() is a loaded node, so the Loading steps above are already
+ *   done):

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.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Awesome. Committed to CVS HEAD. Thanks jhodgdon -- keep rocking it!

jhodgdon’s picture

Status: Fixed » Needs review
StatusFileSize
new3.06 KB

Taking 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().

jhodgdon’s picture

Here'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()

dries’s picture

Status: Needs review » Fixed

Committed the patch in #8. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.