public function ConfigSubscriber::onConfigImporterValidate in Drupal 10
Same name and namespace in other branches
- 8 core/modules/config/src/ConfigSubscriber.php \Drupal\config\ConfigSubscriber::onConfigImporterValidate()
- 9 core/modules/config/src/ConfigSubscriber.php \Drupal\config\ConfigSubscriber::onConfigImporterValidate()
Checks that the Configuration module is not being uninstalled.
Parameters
\Drupal\Core\Config\ConfigImporterEvent $event: The config import event.
Overrides ConfigImportValidateEventSubscriberBase::onConfigImporterValidate
File
- core/
modules/ config/ src/ ConfigSubscriber.php, line 20
Class
- ConfigSubscriber
- Config subscriber.
Namespace
Drupal\configCode
public function onConfigImporterValidate(ConfigImporterEvent $event) {
// Make sure config syncs performed via the Config UI don't break, but
// don't worry about syncs initiated via the command line.
if (PHP_SAPI === 'cli') {
return;
}
$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.'));
}
}