[development] Hook ordering

Karoly Negyesi karoly at negyesi.net
Wed Jan 3 22:33:10 UTC 2007


Reading the hook_nodeapi thread...

In Drupal 6 I would like to see a hook registry -- mostly autodiscovered,  
but if you want ordering, then you can say "my implementation of  
hook_nodeapi is to be run before module this,that,foor,bar". Available in  
my sandbox, weight.php . It's trivial to extend this capatibility to  
packages as well, so that if you ask to be run before !views then you will  
run before all modules that belong to the views package.

All nice and dandy. But, the next step would be to request for "I want to  
be the first for hook_foo". What am I to do if two module asks for this?  
Die a horrible death? Disable the offending modules? This code, quite  
obviously will run on the modules page.



Ps. Extending hook registry to hook#op is also in the plans.

More information about the development mailing list