[development] changes to hook_nodeapi

Peter Wolanin pwolanin at gmail.com
Thu Aug 31 13:34:28 UTC 2006


Dear developers,

A patch was recently committed: http://drupal.org/node/68418 that
moves the insert/update/delete operations out of hook_nodeapi.  While
I realize this was reviewed by a number of more experienced people, I
would still like to voice an objection.

After trying to use the API after this patch, I think it was not a
good idea. I can't see how it improves programmatic submission of
nodes- after trying it last night it seems to make it harder.

It was argued that this would make the node update/insert/delete
process mroe efficienct since only the registered submit sitems in the
form are called rather than hook_nodeapi() for all modules.  However,
I think an approach that would be similer, but much more consistent
with the current API, simpler in terms of updating contrib modules,
and essentially the same in terms of reducing the # of fucntion calls
would be breaking of hook_nodeapi into a series of hooks like
hook_nodeapi_view(), hook_nodeapi_load(), hook_nodeapi_update(). This
would probably add much more in terms of efficiency than this patch
since there are typically many more load, view, etc. operations than
update/insert/delete.

-Peter


More information about the development mailing list