Created
October 22, 2014 00:10
-
-
Save q0rban/3521f9c89d99c67d507c to your computer and use it in GitHub Desktop.
Enabling Drupal modules in an update hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hook_update_n() { | |
if (!drupal_check_module('foo')) { | |
throw new DrupalUpdateException('Foo does not have requirements needed to be enabled.'); | |
} | |
module_enable(array('foo')); | |
return t('Enabled Foo module.'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment