$op can also be 'prepare', this is not mentioned in the API docs: http://api.drupal.org/api/4.7/function/hook_nodeapi

There is some mention of it here: http://drupal.org/node/22218. Having that API documentation up-to-date would be a blessing. It's hard to develop/debug without it.

Comments

pwolanin’s picture

Looks like you're correct, though I'm not quite sure what the prepare op is for.

Do you have CVS access? anyone who does can fix the developer docs. I updated hook_nodeapi not too long ago since the "submit" op was incorrrectly listed as "execute"...

jax’s picture

I don't have CVS access but even if I did I don't think I would be the person to update it with information about 'prepare'. The only thing I know about it is what I found at the links in the issue description. Someone with some more knowledge about the forms api should be able to describe more clearly what it does.

pwolanin’s picture

Status: Active » Fixed

This seems to have been fixed in the docs for 5.0/HEAD (5 weeks ago by jakeg):

http://cvs.drupal.org/viewcvs/drupal/contributions/docs/developer/hooks/...

# "prepare": The node is about to be shown on the add/edit form

Somehow this change seems to have been lost when webchick branched the docs for 4.7. I'll add the same to the 4.7 docs.

Anonymous’s picture

Status: Fixed » Closed (fixed)