Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / search / src / Form / SearchPageForm.php
index 88b99e55eba3be8bdae6e136fdaac0b12fec2613..e46195baeaa2b877f03090e58dac4b77debb4589 100644 (file)
@@ -2,9 +2,10 @@
 
 namespace Drupal\search\Form;
 
-use Drupal\Core\Entity\EntityForm;
+use Drupal\Core\Form\FormBase;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Url;
+use Drupal\search\SearchPageInterface;
 
 /**
  * Provides a search form for site wide search.
@@ -15,10 +16,10 @@ use Drupal\Core\Url;
  * trigger the search being processed by the controller, and adding in any
  * additional query parameters they need to execute search.
  */
-class SearchPageForm extends EntityForm {
+class SearchPageForm extends FormBase {
 
   /**
-   * {@inheritdoc}
+   * The search page entity.
    *
    * @var \Drupal\search\SearchPageInterface
    */
@@ -34,7 +35,9 @@ class SearchPageForm extends EntityForm {
   /**
    * {@inheritdoc}
    */
-  public function form(array $form, FormStateInterface $form_state) {
+  public function buildForm(array $form, FormStateInterface $form_state, SearchPageInterface $search_page = NULL) {
+    $this->entity = $search_page;
+
     $plugin = $this->entity->getPlugin();
     $form_state->set('search_page_id', $this->entity->id());
 
@@ -72,16 +75,7 @@ class SearchPageForm extends EntityForm {
 
     // Allow the plugin to add to or alter the search form.
     $plugin->searchFormAlter($form, $form_state);
-
-    return parent::form($form, $form_state);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function actions(array $form, FormStateInterface $form_state) {
-    // The submit button is added in the form directly.
-    return [];
+    return $form;
   }
 
   /**