Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / tests / modules / entity_test / src / EntityTestForm.php
index 75ff8ad9bf5d931efa1a58ee980688f4f71a01f2..d471d6058200f16b2f1c506795b4a5d45d125594 100644 (file)
@@ -65,7 +65,7 @@ class EntityTestForm extends ContentEntityForm {
       else {
         $message = t('%entity_type @id has been updated.', ['@id' => $entity->id(), '%entity_type' => $entity->getEntityTypeId()]);
       }
-      drupal_set_message($message);
+      $this->messenger()->addStatus($message);
 
       if ($entity->id()) {
         $entity_type = $entity->getEntityTypeId();
@@ -76,7 +76,7 @@ class EntityTestForm extends ContentEntityForm {
       }
       else {
         // Error on save.
-        drupal_set_message(t('The entity could not be saved.'), 'error');
+        $this->messenger()->addError($this->t('The entity could not be saved.'));
         $form_state->setRebuild();
       }
     }