You are here

function webform_uninstall in Webform 6.x

Same name and namespace in other branches
  1. 8.5 webform.install \webform_uninstall()
  2. 5.2 webform.install \webform_uninstall()
  3. 5 webform.install \webform_uninstall()
  4. 6.3 webform.install \webform_uninstall()
  5. 6.2 webform.install \webform_uninstall()
  6. 7.4 webform.install \webform_uninstall()
  7. 7.3 webform.install \webform_uninstall()

Implements hook_uninstall().

File

./webform.install, line 20
Install, update and uninstall functions for the Webform module.

Code

function webform_uninstall() {

  // Issue #2793597: uninstall error You have requested a non-existent service
  // "webform.email_provider".
  // Workaround: Don't use the webform.email_provider in hook_uninstall().
  // @see \Drupal\webform\WebformEmailProvider::uninstall()
  $config = \Drupal::configFactory()
    ->getEditable('system.mail');
  $mail_plugins = $config
    ->get('interface');
  unset($mail_plugins['webform']);
  $config
    ->set('interface', $mail_plugins)
    ->save();

  // Delete editor uploaded files.
  $config = \Drupal::configFactory()
    ->get('webform.settings');
  _webform_config_delete($config);
}