function forward_uninstall in Forward 4.0.x
Same name and namespace in other branches
- 8.3 forward.install \forward_uninstall()
- 8 forward.install \forward_uninstall()
- 8.2 forward.install \forward_uninstall()
- 5 forward.install \forward_uninstall()
- 6 forward.install \forward_uninstall()
- 7.3 forward.install \forward_uninstall()
- 7 forward.install \forward_uninstall()
- 7.2 forward.install \forward_uninstall()
- 4.x forward.install \forward_uninstall()
Implements hook_uninstall().
File
- ./
forward.install, line 45 - Install, update and uninstall functions for the forward module.
Code
function forward_uninstall() {
// Remove the Forward mail plugin.
$config = \Drupal::configFactory()
->getEditable('system.mail');
$mail_plugins = $config
->get('interface');
unset($mail_plugins['forward_send_entity']);
$config
->set('interface', $mail_plugins)
->save();
// If the MailSystem module is enabled, remove the Forward module setting.
if (\Drupal::service('module_handler')
->moduleExists('mailsystem')) {
$config = \Drupal::configFactory()
->get('mailsystem.settings')
->get('modules');
if (!empty($config['forward'])) {
unset($config['forward']);
if (empty($config)) {
\Drupal::configFactory()
->getEditable('mailsystem.settings')
->clear('modules')
->save();
}
else {
\Drupal::configFactory()
->getEditable('mailsystem.settings')
->set('modules', $config)
->save();
}
}
}
// Remove the Forward logs view.
$view = \Drupal::service('entity_type.manager')
->getStorage('view')
->load('forward_logs');
if ($view) {
$view
->delete();
}
// Remove the Forward statistics view.
$view = \Drupal::service('entity_type.manager')
->getStorage('view')
->load('forward_statistics');
if ($view) {
$view
->delete();
}
}