summaryrefslogtreecommitdiffstats
path: root/core/modules/field_ui/src/Form/FieldStorageAddForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/field_ui/src/Form/FieldStorageAddForm.php')
-rw-r--r--core/modules/field_ui/src/Form/FieldStorageAddForm.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/field_ui/src/Form/FieldStorageAddForm.php b/core/modules/field_ui/src/Form/FieldStorageAddForm.php
index 584cc96..5afd358 100644
--- a/core/modules/field_ui/src/Form/FieldStorageAddForm.php
+++ b/core/modules/field_ui/src/Form/FieldStorageAddForm.php
@@ -370,7 +370,7 @@ class FieldStorageAddForm extends FormBase {
}
catch (\Exception $e) {
$error = TRUE;
- drupal_set_message($this->t('There was a problem creating field %label: @message', ['%label' => $values['label'], '@message' => $e->getMessage()]), 'error');
+ $this->messenger()->addError($this->t('There was a problem creating field %label: @message', ['%label' => $values['label'], '@message' => $e->getMessage()]));
}
}
@@ -401,7 +401,7 @@ class FieldStorageAddForm extends FormBase {
}
catch (\Exception $e) {
$error = TRUE;
- drupal_set_message($this->t('There was a problem creating field %label: @message', ['%label' => $values['label'], '@message' => $e->getMessage()]), 'error');
+ $this->messenger()->addError($this->t('There was a problem creating field %label: @message', ['%label' => $values['label'], '@message' => $e->getMessage()]));
}
}
@@ -411,7 +411,7 @@ class FieldStorageAddForm extends FormBase {
$form_state->setRedirectUrl(FieldUI::getNextDestination($destinations, $form_state));
}
elseif (!$error) {
- drupal_set_message($this->t('Your settings have been saved.'));
+ $this->messenger()->addStatus($this->t('Your settings have been saved.'));
}
}