What is the reason for calling hook_form_FORM_ID_alter() first, then hook_form_alter()? Can we reverse this?

For content type node form alter, I want to use hook_form_FORM_ID_alter() but cannot because a lot of CCK things are added with hook_form_alter(). So I end up with a giant hook_form_alter() with lots of switch case goint to each specific content type. I think it make more sense if the hook_form_FORM_ID_alter() is called *after* hook_form_alter().

Comments

mdupont’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Closed (works as designed)

The developers decided the most specific hook should be called first, however for what you want to do you can use a custom callback function added to $form['#after_build'][] since these callbacks will run after the form_alter()k