You are here

function yamlform_uninstall in YAML Form 8

Implements hook_uninstall().

File

./yamlform.install, line 19
Install, update and uninstall functions for the YAML Form module.

Code

function yamlform_uninstall() {

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