find the absolute order of hooks and modules?
Hello, Does anyone know if: Is it possible to find out the order of hooks calls when a page is called? Is there a rule or function that determines this? Is it immutable and dependable information that can used in the creation of a module? Is it possible to find out the order of modules being loaded when a page is called. Is there a rule or function that determines this? Is it immutable and dependable information ? I seem to remember seeing that modules are loaded in alphabetical order. Is this true? Would it be safe to say when a forum node is called then Comment Forum Node is the order? or would it be something different everytime? TIA (sorry if this is a duplicate but my mail does not seem to go through to the list is there a delay of some sort ?)
Is it possible to find out the order of hooks calls when a page is
called? Is there a rule or function that determines this? Is it immutable and dependable information that can used in the creation of a module?
in HEAD Drupal, this order can be customized via the system table. see the weight column. module_list() uses that ordering for its hook invocations.
On 2/22/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
in HEAD Drupal, this order can be customized via the system table. see the weight column. module_list() uses that ordering for its hook invocations.
Is this configurable on any admin screens or only in the DB? I'm assuming if one develops a specific module that should run last it can have in it's hook_install() a query that sets it weight to 10 or something, right? ted
Not quite what I am doing but basically I need to know which hook fires because the database processes have to be in a certain order otherwise table and fields information may not exist and be called for in the process. I thought that there may be some way of creating SQL on the fly also if this order was known. On 2/22/06, Theodore Serbinski <tss24@cornell.edu> wrote:
On 2/22/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
in HEAD Drupal, this order can be customized via the system table. see the weight column. module_list() uses that ordering for its hook invocations.
Is this configurable on any admin screens or only in the DB?
I'm assuming if one develops a specific module that should run last it can have in it's hook_install() a query that sets it weight to 10 or something, right?
ted
Is this configurable on any admin screens or only in the DB?
I'm assuming if one develops a specific module that should run last it can have in it's hook_install() a query that sets it weight to 10 or something, right?
ted
i would expect some contrib module to arise which gives this a UI. we decided that core need not bother admins with this ... yes, a module is free to reorder the list.
I am curious about this. If the order can be changed by the admin but by a module then it is from a default order right? I have seen in previous versions where sometimes people have problems because of the order that modules get loaded and so the hooks are not available down the line. So is there a safety valve in 4.7 to keep this from happening? If I go with 4.7 I don't want to create a monster that will lock up peoples installs or wipe anything clean. On 2/22/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
Is this configurable on any admin screens or only in the DB?
I'm assuming if one develops a specific module that should run last it can have in it's hook_install() a query that sets it weight to 10 or something, right?
ted
i would expect some contrib module to arise which gives this a UI. we decided that core need not bother admins with this ... yes, a module is free to reorder the list.
On Thu, 2006-02-23 at 09:34 +0100, Nathan Digriz wrote:
I am curious about this. If the order can be changed by the admin but by a module then it is from a default order right?
I have seen in previous versions where sometimes people have problems because of the order that modules get loaded and so the hooks are not available down the line. So is there a safety valve in 4.7 to keep this from happening? If I go with 4.7 I don't want to create a monster that will lock up peoples installs or wipe anything clean.
No the hooks will be available... Modules are all loaded first. The module ordering only affects the order they are called in during a module_invoke_all. The order in which the module hooks take effect is what changes. There are some use cases where finer grained control, like ordering per hook could be helpful, might be necessary, but the primitive ordering in place now has done the job so far.
On 2/22/06, Moshe Weitzman <weitzman@tejasa.com> wrote:
> Is this configurable on any admin screens or only in the DB? > > I'm assuming if one develops a specific module that should run last it > can have in it's hook_install() a query that sets it weight to 10 or > something, right? > > ted
i would expect some contrib module to arise which gives this a UI. we decided that core need not bother admins with this ... yes, a module is free to reorder the list.
Op woensdag 22 februari 2006 18:01, schreef Moshe Weitzman:
in HEAD Drupal, this order can be customized via the system table. see the weight column. module_list() uses that ordering for its hook invocations.
All versions previous to HEAD, indeed, use alphabetic ordering. Hence the fact some modules are called zz_foobar.module. It is safe to assume a single hook in <= 4.6 is thus called in alphabetic order. The order of the specific hooks (_init, _load etc) are, however, hardcoded and are poorly documented, exept on some external site. I do not recall the URL, nor does google :( Bèr -- [ End user Drupal services and hosting | Sympal.nl ]
I am working in version 4.6 so yes, this is the information I was looking for. Too bad about the hook information though as it is very important at this stage. I'll see if Google is kinder to me. On 2/22/06, Bèr Kessels <ber@webschuur.com> wrote:
Op woensdag 22 februari 2006 18:01, schreef Moshe Weitzman:
in HEAD Drupal, this order can be customized via the system table. see the weight column. module_list() uses that ordering for its hook invocations.
All versions previous to HEAD, indeed, use alphabetic ordering. Hence the fact some modules are called zz_foobar.module. It is safe to assume a single hook in <= 4.6 is thus called in alphabetic order. The order of the specific hooks (_init, _load etc) are, however, hardcoded and are poorly documented, exept on some external site. I do not recall the URL, nor does google :(
Bèr
-- [ End user Drupal services and hosting | Sympal.nl ]
participants (6)
-
Anders Hamilton -
Bèr Kessels -
Darrel O'Pry -
Moshe Weitzman -
Nathan Digriz -
Theodore Serbinski