As pointed out by Justin Ellison on the Development email list...

In Drupal 6, drupal_prepare_form() definitely [look at bottom of function] invokes hook_form_FORM_ID_alter() before hook_form_alter(), but the hook documentation states the opposite.

In Drupal 7, drupal_prepare_form() apparently calls the generic hook_form_alter() first, then hook_form_BASE_FORM_ID_alter, then hook_form_FORM_ID_alter(). The doc is correct in D7.

CommentFileSizeAuthor
#2 docs_1031458.patch1.42 KBdrewish

Comments

drewish’s picture

Assigned: Unassigned » drewish

I'll take a swing at this.

drewish’s picture

Status: Active » Needs review
StatusFileSize
new1.42 KB

How's this look?

jhodgdon’s picture

I'm not sure I like the bit about "most modules use hook_form_alter()". Actually, at least in D7 I think the opposite is true. And I prefer hook_form_FORM_ID_alter() because it is (a) self-documenting which form you are altering in the function name and (b) you don't have to do a big switch on the form ID because it is already specific.

I guess I'll have to figure out this git stuff so I can commit this eventually. :)

Status: Needs review » Needs work

The last submitted patch, docs_1031458.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Closed (duplicate)