You are here

function yamlform_modules_uninstalled in YAML Form 8

Implements hook_modules_uninstalled().

File

./yamlform.module, line 84
Enables the creation of forms and questionnaires.

Code

function yamlform_modules_uninstalled($modules) {

  // Remove uninstalled module's third party settings from admin settings.
  $config = \Drupal::configFactory()
    ->getEditable('yamlform.settings');
  $third_party_settings = $config
    ->get('third_party_settings');
  foreach ($modules as $module) {
    unset($third_party_settings[$module]);
  }
  $config
    ->set('third_party_settings', $third_party_settings);
  $config
    ->save();

  // Check HTML email provider support as modules are ininstalled.

  /** @var \Drupal\yamlform\YamlFormEmailProviderInterface $email_provider */
  $email_provider = \Drupal::service('yamlform.email_provider');
  $email_provider
    ->check();
}