diff --git a/core/modules/search/src/Form/SearchBlockForm.php b/core/modules/search/src/Form/SearchBlockForm.php index af72de5..dded225 100644 --- a/core/modules/search/src/Form/SearchBlockForm.php +++ b/core/modules/search/src/Form/SearchBlockForm.php @@ -74,9 +74,9 @@ public function getFormId() { /** * {@inheritdoc} */ - public function buildForm(array $form, FormStateInterface $form_state, $id = NULL) { + public function buildForm(array $form, FormStateInterface $form_state, $entity_id = NULL) { // Set up the form to submit using GET to the correct search page. - if (!$id) { + if (!$entity_id) { $entity_id = $this->searchPageRepository->getDefaultSearchPage(); // SearchPageRepository::getDefaultSearchPage() depends on // search.settings. The dependency needs to be added before the @@ -85,9 +85,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $id = NUL // and would not be invalidated if that changes. $this->renderer->addCacheableDependency($form, $this->configFactory->get('search.settings')); } - else { - $entity_id = $id; - } if (!$entity_id) { $form['message'] = [ diff --git a/core/modules/search/src/Plugin/Block/SearchBlock.php b/core/modules/search/src/Plugin/Block/SearchBlock.php index c572953..b206b79 100644 --- a/core/modules/search/src/Plugin/Block/SearchBlock.php +++ b/core/modules/search/src/Plugin/Block/SearchBlock.php @@ -68,7 +68,7 @@ public function build() { */ public function defaultConfiguration() { return [ - 'search_page' => 0, + 'search_page' => '', ]; }