Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2009 at 03:47 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
david straussComment #2
david straussComment #3
mfer commentedUnder orders to say "hell yeah".
Comment #4
damien tournoud commentedThat's so cool (@webchick).
Comment #5
Crell commentedAmen and pass the sweet potatoes!
Comment #6
webchickYAY!!! :D This patch powered by delicious melted ice cream.
Needs documenting.
Comment #7
david straussHere's what should be added to http://drupal.org/node/224333
Comment #8
stella commentedLooks like you also need to add in a bit about
node_invoke_nodeapi()being renamed tonode_invoke_node()Comment #9
xanoI advise against this. We need to rename hooks like hook_load() to hook_node_load(), since hook names start with the name of the module that introduces them, and this patch would conflict with that.
Comment #10
stella commented@Xano this is already committed
Comment #11
xanoMy bad, but my advise still stands. Hook_load(), hook_form(), etc. are confusing and make the API even more sloppy. If we change them to hook_node_load(), etc., we need to think of al alternative for hook_nodeapi_X().
Comment #12
damien tournoud commented@Xano: *_load(), *_form(), etc. are not really hooks as there are not called by module_invoke_all(). There are a rather dumb implementation of a strategy pattern. We need a better system for D7, for sure (probably based on some DrupalNodeType interface), renaming *_load() to *_node_load() would only add to the confusion.
See #395786: Move node-type callbacks to a proper interface.
Comment #13
david straussWith Damien's issue #395786, I'm setting this back to CNW for documentation.
Comment #14
webchickComment #15
webchickEr. I didn't mean to do that.
Comment #16
webchickAlso, I agree with Damien that the pseudo-hooks _load, _insert, etc. are their own thing and should be dealt with separately. Maybe by turning them OO as in #395786: Move node-type callbacks to a proper interface but that's for discussion over there. :)
But hook_user_X, hook_file_X, etc. all match the pattern of "Someone else defined this thing, and now my module wants to act on it." So hook_node_X is a good fit here.
Comment #17
rfayI added this into the docs at http://drupal.org/update/modules/6/7#hook_node_xxx
I attempted to update all previous references (now outdated) to hook_nodeapi_xxx() as well.