Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / config / src / Form / ConfigSingleImportForm.php
index 9f9a8d9281a73396679b25f58622dae58215f12b..83e776c0b0c12a9bb6212cae9db8ef5217c6f54f 100644 (file)
@@ -62,7 +62,7 @@ class ConfigSingleImportForm extends ConfirmFormBase {
   /**
    * The configuration manager.
    *
-   * @var \Drupal\Core\Config\ConfigManagerInterface;
+   * @var \Drupal\Core\Config\ConfigManagerInterface
    */
   protected $configManager;
 
@@ -395,7 +395,7 @@ class ConfigSingleImportForm extends ConfirmFormBase {
     /** @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 {
@@ -416,9 +416,9 @@ class ConfigSingleImportForm extends ConfirmFormBase {
       }
       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);
         }
       }
     }