Community Documentation

hook_uninstall

5 install.php hook_uninstall()
6 install.php hook_uninstall()
7 system.api.php hook_uninstall()
8 system.api.php hook_uninstall()

Remove any information that the module sets.

The information that the module should remove includes:

  • Variables that the module has set using variable_set().
  • Modifications to existing tables.
  • Database tables the module created.

The uninstall hook must be implemented in the module's .install file. It will fire when the module gets uninstalled.

Related topics

▾ 19 functions implement hook_uninstall()

aggregator_uninstall in modules/aggregator/aggregator.install
Implementation of hook_uninstall().
blogapi_uninstall in modules/blogapi/blogapi.install
Implementation of hook_uninstall().
book_uninstall in modules/book/book.install
Implementation of hook_uninstall().
contact_uninstall in modules/contact/contact.install
Implementation of hook_uninstall().
dblog_uninstall in modules/dblog/dblog.install
Implementation of hook_uninstall().
forum_uninstall in modules/forum/forum.install
Implementation of hook_uninstall().
locale_uninstall in modules/locale/locale.install
Implementation of hook_uninstall().
menu_uninstall in modules/menu/menu.install
Implementation of hook_uninstall().
openid_uninstall in modules/openid/openid.install
Implementation of hook_uninstall().
poll_uninstall in modules/poll/poll.install
Implementation of hook_uninstall().
profile_uninstall in modules/profile/profile.install
Implementation of hook_uninstall().
search_uninstall in modules/search/search.install
Implementation of hook_uninstall().
statistics_uninstall in modules/statistics/statistics.install
Implementation of hook_uninstall().
syslog_uninstall in modules/syslog/syslog.install
Implements hook_uninstall().
system_modules_uninstall in modules/system/system.admin.inc
Builds a form of currently disabled modules.
theme_system_modules_uninstall in modules/system/system.admin.inc
Themes a table of currently disabled modules.
trigger_uninstall in modules/trigger/trigger.install
Implementation of hook_uninstall().
update_uninstall in modules/update/update.install
Implementation of hook_uninstall().
upload_uninstall in modules/upload/upload.install
Implementation of hook_uninstall().

File

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

Code

<?php
function hook_uninstall() {
  drupal_uninstall_schema('upload');
  variable_del('upload_file_types');
}
?>

Comments

Delete created view during uninstallation of custom module

Hi,
I have created my own custom moduel. I am creating default view during installation of module. The thing is working properly.

But I want to delete my custom created view during un-installation of my custom module. But I am unable to do so.

Can anybody help me.

Abhishek
globalabhishek@gmail.com

Login or register to post comments