Skip to content
Snippets Groups Projects

Issue #3502442: Added install file to remove configurations on module uninstall

1 file
+ 30
0
Compare changes
  • Side-by-side
  • Inline
+ 30
0
<?php
/**
* @file
* Install, update and uninstall functions for Group domain.
*/
/**
* Implements hook_uninstall().
*
* Deletes the configuration for field.storage.group.group_domain
* and clears cache.
*/
function group_domain_uninstall() {
// Get the configuration factory service.
$config_factory = \Drupal::service('config.factory');
// Load the configuration for field.storage.group.group_domain
// and delete the configuration.
$config = $config_factory->getEditable('field.storage.group.group_domain');
if (!$config->isNew()) {
// Delete the configuration.
$config->delete();
}
// Clear specific cache bins.
\Drupal::cache('data')->deleteAll();
\Drupal::cache('render')->deleteAll();
}
Loading