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

drupal vlado at dikini.net
Tue Apr 18 09:14:08 UTC 2006


> * roundtrip calls (or any other names): A hook returns roundtrip = TRUE if it 
> wants the hook to be invoked again. mymodule_load() adds something and sets 
> roundtrip = TRUE. node_load() would be re-invoked completely, but now with 
> the additioanl info injected by mymodule_load() 
yes, might work, but is not going to improve by much the current state

> * (re) define all the messages that an Object in OOP has. We could/should have 
> hook calls for each and every one of them. Examples: init load create read 
> update insert delete ... Then we make sure that drupal calls ALL these $ops 
> for ANY hook, at ALL times. This wll make hooks more consistent across 
> Drupal, give us a central place to cache/improve/change hooks and so on. 
$ops are messages, hooks are a kind of a message as well. Implementing a
fixed, well defined set of messages called on every single hook call
will make it a performance nightmare.

A far better solution, from a flexiibility point of view, is to be able
to schedule for invoke a new hook. For example, if something wants to
run before load, it can schedule in init "my_post_init_hook". This way
it is guaranteed to run after init and  before load. It houldn't be a
lot of work, and addresses, at least partially, the flexible page
workflow ramblings. The dowenside of this is that it will make debugging
code harder. But that is quite hard anyway, and needs to be addressed. 

Cheers,
Vlado




More information about the development mailing list