function forward_uninstall in Forward 8
Same name and namespace in other branches
- 8.3 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()
- 4.0.x forward.install \forward_uninstall()
Implements hook_uninstall().
File
- ./
forward.install, line 41 - Install, update and uninstall functions for the forward module.
Code
function forward_uninstall() {
// Clear default values for config which require dynamic values.
\Drupal::configFactory()
->getEditable('forward.settings')
->clear('forward_email_from_address')
->save();
// 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();
// Remove the custom view mode
$view_mode = EntityViewMode::load('node.forward');
if ($view_mode) {
$view_mode
->delete();
}
// 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();
}
}