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.

CommentFileSizeAuthor
#3 hooks_docs.patch4.26 KBdrewish

Comments

chx’s picture

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

drewish’s picture

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?

drewish’s picture

Status: Active » Needs work
StatusFileSize
new4.26 KB

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

drewish’s picture

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

drewish’s picture

Add: form_alter
hook_form_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):

'prepare', 'validate', 

'load'
'view'

Corresponding to the node operations:
'insert', 'update', 'delete'

Render this an an RSS feed
'rss item'

Search related
'update index'
'search result'

Content type settings
'settings'

Node Hooks (need to verify these)
1. prepare
2. form (return an array)
3. validate (you can only validate here, no changes possible)
4. execute (prepare the node for save)
5. insert/update

drewish’s picture

eh, crap, didn't mean to post that. i was working on some notes.

sepeck’s picture

Status: Needs work » Closed (fixed)

re-open i fthis is still true.