function hook_module_preuninstall
Same name in other branches
- 9 core/lib/Drupal/Core/Extension/module.api.php \hook_module_preuninstall()
- 8.9.x core/lib/Drupal/Core/Extension/module.api.php \hook_module_preuninstall()
- 10 core/lib/Drupal/Core/Extension/module.api.php \hook_module_preuninstall()
Perform necessary actions before a module is uninstalled.
Parameters
string $module: The name of the module about to be uninstalled.
bool $is_syncing: TRUE if the module is being uninstalled as part of a configuration import. In these cases, your hook implementation needs to carefully consider what changes to configuration objects or configuration entities. Those changes should be made earlier and exported so during import there's no need to do them again.
Related topics
1 string reference to 'hook_module_preuninstall'
- OtherModuleUninstalledHooks::modulePreuninstall in core/
modules/ system/ tests/ modules/ respond_install_uninstall_hook_test/ src/ Hook/ OtherModuleUninstalledHooks.php - Implements hook_module_preuninstall().
1 invocation of hook_module_preuninstall()
- ModuleInstaller::uninstall in core/
lib/ Drupal/ Core/ Extension/ ModuleInstaller.php - Uninstalls a given list of modules.
File
-
core/
lib/ Drupal/ Core/ Extension/ module.api.php, line 273
Code
function hook_module_preuninstall($module, bool $is_syncing) : void {
my_module_cache_clear();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.