Search code examples
drupal-7hook

Order of hooks during Drupal 7 install


I'd like to know in what order following hooks called:

hook_install hook_enable any other hooks

Basically What I'd like to know is if any hooks in my .module file are called before calling hook_enable.

In other words what is the order of calling hooks: A: install, any, enable B: install, enable, any

Some reference would be appreciated ( i haven't found any).

Thanks


Solution

  • There's some useful info on extracting the hook calls here: https://www.lullabot.com/blog/article/drupal-exposed

    This one will probably help you: Open includes/module.inc and find the module_implements function. Add the following line:

    drupal_set_message("hook_$hook");
    

    This should give you a list of hooks as they are called. Presumably, if you install a module you should see the install hooks in action.