[documentation] [task] Update hook_* documentation for 4.7

drewish drupal-docs at drupal.org
Wed Nov 23 18:23:41 UTC 2005


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

 Project:      Documentation
 Version:      <none>
 Component:    Developer Guide
 Category:     tasks
 Priority:     normal
 Assigned to:  drewish
 Reported by:  drewish
 Updated by:   drewish
 Status:       patch (code needs work)

Looks like most of the _alter hooks are going to be removed...
http://drupal.org/node/38349




drewish



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

Wed, 09 Nov 2005 20:23:19 +0000 : drewish

The following functions need documentation:
hook_form_alter()
hook_form_validate_alter()
hook_form_execute_alter()


Additionally, I've noticed that the following hook documentation needs
to be updated to use the new Forms API for 4.7:
hook_block()
hook_settings()
hook_user()


This isn't meant to be a complete list, just a starting point. Please
add any other hooks you may find.




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

Wed, 09 Nov 2005 20:28:41 +0000 : chx

hook_nodeapi op validate changed, prepare and execute are new. there are
similar hooks I suppose.




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

Wed, 09 Nov 2005 20:49:37 +0000 : drewish

*Parameters for form hooks*
I'm assuming that the values all have to be by reference...
hook_form_alter($form_id, &$form_values)
hook_form_validate_alter($form_id, &$form_values)
hook_form_execute_alter($form_id, &$form_values)


*Possible values for $op in hook_nodeapi()*
These are what I've found greping through node.module (I've grouped
them in what appeared to be a logical order to me):
'load', 'insert', 'update', 'delete',
'view', 'rss item',
'prepare', 'validate', 'form',
'update index', 'search result',
'settings', 


Can someone confirm this?




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

Fri, 11 Nov 2005 09:22:10 +0000 : drewish

Attachment: http://drupal.org/files/issues/hooks_docs.patch (4.26 KB)

Here's a basic patch that adds prototypes for the new hooks and converts
some of the form api code.






More information about the documentation mailing list