You are here

public function ConfigSubscriber::onConfigImporterValidate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config/src/ConfigSubscriber.php \Drupal\config\ConfigSubscriber::onConfigImporterValidate()

Checks that the Configuration module is not being uninstalled.

Parameters

ConfigImporterEvent $event: The config import event.

Overrides ConfigImportValidateEventSubscriberBase::onConfigImporterValidate

File

core/modules/config/src/ConfigSubscriber.php, line 26
Contains \Drupal\config\ConfigSubscriber.

Class

ConfigSubscriber
Config subscriber.

Namespace

Drupal\config

Code

public function onConfigImporterValidate(ConfigImporterEvent $event) {
  $importer = $event
    ->getConfigImporter();
  $core_extension = $importer
    ->getStorageComparer()
    ->getSourceStorage()
    ->read('core.extension');
  if (!isset($core_extension['module']['config'])) {
    $importer
      ->logError($this
      ->t('Can not uninstall the Configuration module as part of a configuration synchronization through the user interface.'));
  }
}