5.x install.php hook_enable()
6.x install.php hook_enable()
7.x system.api.php hook_enable()

Perform necessary actions after module is enabled.

The hook is called everytime module is enabled.

Related topics

4 functions implement hook_enable()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

comment_enable in modules/comment/comment.install
Implementation of hook_enable().
forum_enable in modules/forum/forum.install
menu_enable in modules/menu/menu.module
Implementation of hook_enable()
module_enable in includes/module.inc
Enable a given list of modules.


developer/hooks/install.php, line 358
Documentation for the installation and update system.


function hook_enable() {


greg.harvey’s picture

This hook is invoked in module.inc in the module_enable() function. It's worth noting that because Drupal is still in the install "pass", the module is not bootstrapped yet, so not fully "enabled". For example, if it provides views or ctools exportables, they will not be available as their hooks will not have fired yet, nor will any menu paths, etc. This happens directly after the system table is updated, so it's not truly the "post-install" hook I'd hoped for. Hope this helps others.