/**
* The configuration manager.
*
- * @var \Drupal\Core\Config\ConfigManagerInterface;
+ * @var \Drupal\Core\Config\ConfigManagerInterface
*/
protected $configManager;
/** @var \Drupal\Core\Config\ConfigImporter $config_importer */
$config_importer = $form_state->get('config_importer');
if ($config_importer->alreadyImporting()) {
- drupal_set_message($this->t('Another request may be importing configuration already.'), 'error');
+ $this->messenger()->addError($this->t('Another request may be importing configuration already.'));
}
else {
try {
}
catch (ConfigImporterException $e) {
// There are validation errors.
- drupal_set_message($this->t('The configuration import failed for the following reasons:'), 'error');
+ $this->messenger()->addError($this->t('The configuration import failed for the following reasons:'));
foreach ($config_importer->getErrors() as $message) {
- drupal_set_message($message, 'error');
+ $this->messenger()->addError($message);
}
}
}