Please add documentation about hook_prepare called
with $op = 'prepare'

Thanks,
Fabio

Comments

dman’s picture

Seconded!
I found it mentioned over in the upgrade overview and it seems that as op=validate doesn't take modifications anymore that "prepare" must be where I'm supposed to do that. ... but it doesn't.
The HEAD docs still have the old version. (this is why I hate putting docs in different places than the code, although I know it's neccessary sometimes)

node.module has

/**
 * Apply filters to a node in preparation for theming.
 */
function node_prepare($node, $teaser = FALSE) {

... which is not what I'm looking for at all (I thought).

I'm updating htmltidy.module, and I used to be able to correct users markup on-the-fly as they previewed it. (by validating and fixing the HTML on 'validate')

Do I have to to that in op=form now (feels wrong) or what?

.dan.

dman’s picture

Just some notes (maybe off-topic)
Currently the 4.7 node.module node_form() function does NOT trigger a modules hook_nodeapi($op='form'...) like it used to with $op='form pre'.

node_validate() for example, passes on to
node_invoke_nodeapi($node, 'validate');
... which is to say, it allows any modules to validate the node.

Likewise, most of the $ops normally sprung by hook_node_api()
"prepare", "validate", "submit", "load" and "view" do anyway. But NOT "form".

I believe this is because of the new form_alter() method. I take it modules are supposed to use that to do things they used to do in hook_nodeapi($op='form pre') etc.

... but modifying fields there still doesn't reflect the changes on preview. ... still hunting through the code.

Zen’s picture

drupaldocs is being "moved". In the meantime, you can use a mirror and thank merlinofchaos for it :)

-K

webchick’s picture

FYI, anyone with CVS access can update this documentation.

It's found in contributions/docs/developer/hooks/core.php

pnm’s picture

Was this resolved in webchick's patch for http://drupal.org/node/109754 ?

Tresler’s picture

Status: Active » Closed (fixed)

It is listed on api.drupal.org now.

Tresler’s picture

Assigned: Unassigned » Tresler

Tracking in case re-opened

Tresler’s picture

Status: Closed (fixed) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)