[documentation] [Documentation bug] $op = "prepare" not listed on hook_nodeapi docs

pnm drupal-docs at drupal.org
Sat Jan 20 06:06:23 UTC 2007


Issue status update for 
http://drupal.org/node/47476
Post a follow up: 
http://drupal.org/project/comments/add/47476

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  fax8
 Updated by:   pnm
 Status:       active

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




pnm



Previous comments:
------------------------------------------------------------------------

Wed, 01 Feb 2006 23:47:24 +0000 : fax8

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


Thanks,
Fabio




------------------------------------------------------------------------

Sat, 25 Feb 2006 02:23:05 +0000 : dman

Seconded!
I found it mentioned over in the upgrade overview [1] 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 [2] 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
<?php
/**
 * 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.
[1] http://drupal.org/node/22218#node_hook_order
[2] http://drupaldocs.org/api/head/function/hook_nodeapi




------------------------------------------------------------------------

Sat, 25 Feb 2006 04:02:43 +0000 : dman

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() [3]
"prepare", "validate", "submit", "load" and "view" do anyway. But NOT
"form".


I believe this is because of the new form_alter() [4] 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.
[3] http://drupaldocs.org/api/head/function/hook_nodeapi
[4] http://drupaldocs.org/api/head/function/hook_form_alter




------------------------------------------------------------------------

Sat, 25 Feb 2006 05:15:42 +0000 : Zen

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


-K
[5] http://drupal.logrus.com/




------------------------------------------------------------------------

Sat, 25 Feb 2006 05:48:52 +0000 : webchick

FYI, anyone with CVS access can update this documentation.


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






More information about the documentation mailing list