summaryrefslogtreecommitdiffstats
path: root/core/modules/config/src/Form/ConfigSync.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/config/src/Form/ConfigSync.php')
-rw-r--r--core/modules/config/src/Form/ConfigSync.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/modules/config/src/Form/ConfigSync.php b/core/modules/config/src/Form/ConfigSync.php
index f71d6d5..c824679 100644
--- a/core/modules/config/src/Form/ConfigSync.php
+++ b/core/modules/config/src/Form/ConfigSync.php
@@ -191,7 +191,7 @@ class ConfigSync extends FormBase {
return $form;
}
elseif (!$storage_comparer->validateSiteUuid()) {
- drupal_set_message($this->t('The staged configuration cannot be imported, because it originates from a different site than this site. You can only synchronize configuration between cloned instances of this site.'), 'error');
+ $this->messenger()->addError($this->t('The staged configuration cannot be imported, because it originates from a different site than this site. You can only synchronize configuration between cloned instances of this site.'));
$form['actions']['#access'] = FALSE;
return $form;
}
@@ -221,7 +221,7 @@ class ConfigSync extends FormBase {
'#items' => $change_list,
]
];
- drupal_set_message($this->renderer->renderPlain($message), 'warning');
+ $this->messenger()->addWarning($this->renderer->renderPlain($message));
}
}
@@ -330,7 +330,7 @@ class ConfigSync extends FormBase {
$this->getStringTranslation()
);
if ($config_importer->alreadyImporting()) {
- drupal_set_message($this->t('Another request may be synchronizing configuration already.'));
+ $this->messenger()->addStatus($this->t('Another request may be synchronizing configuration already.'));
}
else {
try {
@@ -351,9 +351,9 @@ class ConfigSync extends FormBase {
}
catch (ConfigImporterException $e) {
// There are validation errors.
- drupal_set_message($this->t('The configuration cannot be imported because it failed validation for the following reasons:'), 'error');
+ $this->messenger()->addError($this->t('The configuration cannot be imported because it failed validation for the following reasons:'));
foreach ($config_importer->getErrors() as $message) {
- drupal_set_message($message, 'error');
+ $this->messenger()->addError($message);
}
}
}
@@ -394,13 +394,13 @@ class ConfigSync extends FormBase {
if ($success) {
if (!empty($results['errors'])) {
foreach ($results['errors'] as $error) {
- drupal_set_message($error, 'error');
+ \Drupal::messenger()->addError($error);
\Drupal::logger('config_sync')->error($error);
}
- drupal_set_message(\Drupal::translation()->translate('The configuration was imported with errors.'), 'warning');
+ \Drupal::messenger()->addWarning(\Drupal::translation()->translate('The configuration was imported with errors.'));
}
else {
- drupal_set_message(\Drupal::translation()->translate('The configuration was imported successfully.'));
+ \Drupal::messenger()->addStatus(\Drupal::translation()->translate('The configuration was imported successfully.'));
}
}
else {
@@ -408,7 +408,7 @@ class ConfigSync extends FormBase {
// $operations contains the operations that remained unprocessed.
$error_operation = reset($operations);
$message = \Drupal::translation()->translate('An error occurred while processing %error_operation with arguments: @arguments', ['%error_operation' => $error_operation[0], '@arguments' => print_r($error_operation[1], TRUE)]);
- drupal_set_message($message, 'error');
+ \Drupal::messenger()->addError($message);
}
}