Skip to content

Instantly share code, notes, and snippets.

@sebcunin
Forked from jlavialle/weight_module
Last active December 21, 2015 19:18
Show Gist options
  • Select an option

  • Save sebcunin/6352902 to your computer and use it in GitHub Desktop.

Select an option

Save sebcunin/6352902 to your computer and use it in GitHub Desktop.
Modify the module's weight (#drupal)
/**
* Implements hook_enable()
* @link https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_enable/7
*/
function MYMODULE_NAME_enable() {
db_update('system')
->fields(array('weight' => WEIGHT_VALUE))
->condition('type', 'module')
->condition('name', 'MYMODULE_NAME')
->execute();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment