[development] Giving form_alter an $op and calling it more than once.

Robert Douglass r.douglass at onlinehome.de
Mon Apr 17 23:01:19 UTC 2006


One aspect of the FAPI drives me mad:

mod_a_ form_alter() {
  // wants to do something based on what is in the form
}

mod_b_form_alter() {
  // adds something to the form which would potentially trigger 
something in mod_a
}

The only way to get this to work is by tweaking the weight in the system 
table. Yuck.

There is no way that we will ever resolve all the ordering problems with 
our hook based system--- they plague every hook we have.

--BUT--

Other hooks have help by passing an $op and calling the hook more than 
once. Perhaps form_alter needs an $op { 'add', 'process' }. Or we need 
two hooks:

hook_form_additions
hook_form_alter

I predict that the ordering problem in form_alter will become acute very 
soon. Many people are just waking up to the possibilities the new FAPI 
holds.

cheers,

Robert


More information about the development mailing list