Further Drupal 8.6.4 changes. Some core files were not committed before a commit...
[yaffs-website] / web / core / modules / shortcut / src / ShortcutForm.php
index fa62cdb685f9ebe3fb4a1099146331221033c6ff..f41ba253157afb6346195fdb5f12fae1da8b6578 100644 (file)
@@ -19,6 +19,16 @@ class ShortcutForm extends ContentEntityForm {
    */
   protected $entity;
 
+  /**
+   * {@inheritdoc}
+   */
+  public function form(array $form, FormStateInterface $form_state) {
+    $form = parent::form($form, $form_state);
+    $form['#attached']['library'][] = 'core/drupal.form';
+
+    return $form;
+  }
+
   /**
    * {@inheritdoc}
    */
@@ -42,7 +52,7 @@ class ShortcutForm extends ContentEntityForm {
     else {
       $message = $this->t('Added a shortcut for %title.', ['%title' => $view_link]);
     }
-    drupal_set_message($message);
+    $this->messenger()->addStatus($message);
 
     $form_state->setRedirect(
       'entity.shortcut_set.customize_form',