summaryrefslogtreecommitdiffstats
path: root/core/modules/config/src/Form/ConfigImportForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/config/src/Form/ConfigImportForm.php')
-rw-r--r--core/modules/config/src/Form/ConfigImportForm.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/config/src/Form/ConfigImportForm.php b/core/modules/config/src/Form/ConfigImportForm.php
index 6b7b557..28852f2 100644
--- a/core/modules/config/src/Form/ConfigImportForm.php
+++ b/core/modules/config/src/Form/ConfigImportForm.php
@@ -55,7 +55,7 @@ class ConfigImportForm extends FormBase {
$directory = config_get_config_directory(CONFIG_SYNC_DIRECTORY);
$directory_is_writable = is_writable($directory);
if (!$directory_is_writable) {
- drupal_set_message($this->t('The directory %directory is not writable.', ['%directory' => $directory]), 'error');
+ $this->messenger()->addError($this->t('The directory %directory is not writable.', ['%directory' => $directory]));
}
$form['import_tarball'] = [
'#type' => 'file',
@@ -100,11 +100,11 @@ class ConfigImportForm extends FormBase {
$files[] = $file['filename'];
}
$archiver->extractList($files, config_get_config_directory(CONFIG_SYNC_DIRECTORY));
- drupal_set_message($this->t('Your configuration files were successfully uploaded and are ready for import.'));
+ $this->messenger()->addStatus($this->t('Your configuration files were successfully uploaded and are ready for import.'));
$form_state->setRedirect('config.sync');
}
catch (\Exception $e) {
- drupal_set_message($this->t('Could not extract the contents of the tar file. The error message is <em>@message</em>', ['@message' => $e->getMessage()]), 'error');
+ $this->messenger()->addError($this->t('Could not extract the contents of the tar file. The error message is <em>@message</em>', ['@message' => $e->getMessage()]));
}
drupal_unlink($path);
}