summaryrefslogtreecommitdiffstats
path: root/core/modules/system/src/Form/DateFormatFormBase.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/system/src/Form/DateFormatFormBase.php')
-rw-r--r--core/modules/system/src/Form/DateFormatFormBase.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/modules/system/src/Form/DateFormatFormBase.php b/core/modules/system/src/Form/DateFormatFormBase.php
index ed6714f..9e92a70 100644
--- a/core/modules/system/src/Form/DateFormatFormBase.php
+++ b/core/modules/system/src/Form/DateFormatFormBase.php
@@ -129,7 +129,7 @@ abstract class DateFormatFormBase extends EntityForm {
$pattern = trim($form_state->getValue('date_format_pattern'));
foreach ($this->dateFormatStorage->loadMultiple() as $format) {
if ($format->getPattern() == $pattern && ($format->id() == $this->entity->id())) {
- drupal_set_message(t('The existing format/name combination has not been altered.'));
+ $this->messenger()->addStatus($this->t('The existing format/name combination has not been altered.'));
continue;
}
}
@@ -149,10 +149,10 @@ abstract class DateFormatFormBase extends EntityForm {
public function save(array $form, FormStateInterface $form_state) {
$status = $this->entity->save();
if ($status == SAVED_UPDATED) {
- drupal_set_message(t('Custom date format updated.'));
+ $this->messenger()->addStatus($this->t('Custom date format updated.'));
}
else {
- drupal_set_message(t('Custom date format added.'));
+ $this->messenger()->addStatus($this->t('Custom date format added.'));
}
$form_state->setRedirectUrl($this->entity->urlInfo('collection'));
}