Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / src / Form / DateFormatFormBase.php
index ed6714fc6833b1c80e88bc5314506978e5ba6240..9e92a70c4420afeb4ec8bfc3b8ffa9a2577026f3 100644 (file)
@@ -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'));
   }