Hook Weighting

Events happening in the community are now at Drupal community events on www.drupal.org.
cyu's picture

Right now hooks execute according to the weights assigned to their containing modules in the system table. This means there is no way for module1 to implement hook_form_alter before module2 and also implement hook_nodeapi after module2. I'd like to see an ajaxy interface for defining weights on a per hook basis. This also would generate a summary page for seeing every module that implements a particular hook and the order of execution. Taking this even further would be the idea of weighting based on hook parameters, such as $op...but I'm not so sure about that.

Comments

I like this

agentrickard's picture

As an advanced (read optional) module, I really like this idea. But how to implement in core? Perhaps just allow hooks to define an order. I don't know.

--
http://ken.therickards.com/
http://savannahnow.com/user/2
http://blufftontoday.com/user/3

There's talk of the Registry

catch's picture

There's talk of the Registry making this a lot easier to support: http://drupal.org/node/221964

Once the Registry is in, I

chx's picture

Once the Registry is in, I intend to code this, the skeleton is in my sandbox since 2006 december.

Sweet. I guess that rules it

cyu's picture

Sweet. I guess that rules it out for SoC, but I'm looking forward to seeing this feature in...especially combined with the hook_form_$form-id_alter() functionality.

SoC 2008

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: