ConfigSubscriber::onConfigImporterValidate

public ConfigSubscriber::onConfigImporterValidate(ConfigImporterEvent $event)

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 21

Class

ConfigSubscriber
Config subscriber.

Namespace

Drupal\config

Code

1
2
3
4
5
6
7
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.'));
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.