Drupal - What is required to get a custom module to appear in uninstall list?

For Drupal 6, you needed to install/uninstall schema using hook_install and hook_uninstall.

This is not necessary for Drupal 7.

Module will appear in uninstall list if both of these conditions are met:

  • module implements hook_schema OR hook_uninstall in its .install file.
  • module was enabled once and now is in disabled status.

If the only purpose of hook_uninstall is to uninstall the schema, you do not need a hook_uninstall function. For variable_del(), etc: you need. If you have any of these and module has data in the site already, you will see the uninstall check box.

Tags:

7