Wednesday, January 27, 2016

Drupal 7: How to create update hook



Step 1: Go to the following path and create update hook to perform the action.

sites/all/modules/custom/mymodule/mymodule.install


/**
 * Disabled PSL Newsletter module
 * Implements hook_update_N()
 */
function mymodule_update_7300(&$sandbox) {
   module_disable(array('newsletter'));
   return 'Newsletter has been disabled';
}



Step 2: Go to project root path and run drush updb -y

No comments:

Post a Comment