All four of the module-defined node types that are still in 5.0 core (blog, book, forum, and poll) can and should be made history, and in their place we can just have hook_nodeapi() implementations I definitely agree, but envision some module ordering/weighting issues that will need to be worked out as we begin to unify these since you lose the pre-nodeapi hooks and have everything going at the same "time". chx has done some prelim work on this at http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/chx/weights.php?r... but not sure how far along it is.
Rob Roy Barreca Founder and COO Electronic Insight Corporation http://www.electronicinsight.com rob@electronicinsight.com Jeremy Epstein wrote:
In Drupal 5.0, the difference between hook_insert() / hook_update() and friends, and hook_nodeapi(), is smaller than ever; and there is less need than ever to actually still have the former in core. With the new CCK-partially-in-core features, it's likely that before long, there will be no such thing as module-defined node types. There will only be user-defined node types.
All four of the module-defined node types that are still in 5.0 core (blog, book, forum, and poll) can and should be made history, and in their place we can just have hook_nodeapi() implementations, that allow the same functionality to be available to custom node types (there's also a push to make poll a CCK field type, rather than a node-type-ish thing).
To, in summary: your confusion is understandable! And, since we're pushing for more widespread use of custom content types, I would advise trying to use only hook_nodeapi() in your contrib modules from now on, unless you have a use case where module-defined node types are really appropriate (and such use cases are rare).
Cheers, Jaza.
On 1/3/07, Fernando Silva <fsilva.pt@gmail.com> wrote:
Hi,
In the following page http://api.drupal.org/api/HEAD/function/hook_nodeapi it says: "If you are writing a node module, do not use this hook to perform actions on your type of node alone. Instead, use the hooks set aside for node modules, such as hook_insert() and hook_form()."
My question is why is it better to use the standalone functions instead of the centralized one?
Regards, Fernando Silva