diff --git a/core/modules/search/config/schema/search.schema.yml b/core/modules/search/config/schema/search.schema.yml index 43dcc5fb55..64d75b8db9 100644 --- a/core/modules/search/config/schema/search.schema.yml +++ b/core/modules/search/config/schema/search.schema.yml @@ -93,6 +93,6 @@ block.settings.search_form_block: type: block_settings label: 'Search block' mapping: - search_page: + page_id: type: string label: 'Search page' diff --git a/core/modules/search/src/Plugin/Block/SearchBlock.php b/core/modules/search/src/Plugin/Block/SearchBlock.php index 580ae123a5..fa6424ede1 100644 --- a/core/modules/search/src/Plugin/Block/SearchBlock.php +++ b/core/modules/search/src/Plugin/Block/SearchBlock.php @@ -78,7 +78,7 @@ protected function blockAccess(AccountInterface $account) { * {@inheritdoc} */ public function build() { - $page = $this->configuration['search_page'] ?? NULL; + $page = $this->configuration['page_id'] ?? NULL; return $this->formBuilder->getForm(SearchBlockForm::class, $page); } @@ -87,7 +87,7 @@ public function build() { */ public function defaultConfiguration() { return [ - 'search_page' => '', + 'page_id' => '', ]; } @@ -103,11 +103,11 @@ public function blockForm($form, FormStateInterface $form_state) { $options[$entity_id] = $entity->label(); } - $form['search_page'] = [ + $form['page_id'] = [ '#type' => 'select', '#title' => $this->t('Search page'), '#description' => $this->t('The configured search page that the form submits to. Leave blank to use your default search page.'), - '#default_value' => $this->configuration['search_page'], + '#default_value' => $this->configuration['page_id'], '#options' => $options, '#empty_option' => $this->t('Default'), '#empty_value' => '', @@ -120,7 +120,7 @@ public function blockForm($form, FormStateInterface $form_state) { * {@inheritdoc} */ public function blockSubmit($form, FormStateInterface $form_state) { - $this->configuration['search_page'] = $form_state->getValue('search_page'); + $this->configuration['page_id'] = $form_state->getValue('page_id'); } } diff --git a/core/modules/search/tests/src/Functional/Update/BlockPageSettingTest.php b/core/modules/search/tests/src/Functional/Update/BlockPageSettingTest.php index b5292245f3..d11ef0bdef 100644 --- a/core/modules/search/tests/src/Functional/Update/BlockPageSettingTest.php +++ b/core/modules/search/tests/src/Functional/Update/BlockPageSettingTest.php @@ -28,12 +28,12 @@ protected function setDatabaseDumpFiles() { */ public function testUpdateActionPlugins() { $config = \Drupal::configFactory()->get('block.block.bartik_search'); - $this->assertArrayNotHasKey('search_page', $config->get('settings')); + $this->assertArrayNotHasKey('page_id', $config->get('settings')); $this->runUpdates(); $config = \Drupal::configFactory()->get('block.block.bartik_search'); - $this->assertSame('', $config->get('settings')['search_page']); + $this->assertSame('', $config->get('settings')['page_id']); } } diff --git a/core/modules/system/tests/fixtures/update/block.block.secondtestfor2354889.yml b/core/modules/system/tests/fixtures/update/block.block.secondtestfor2354889.yml index 849d605adb..e7ee5eda13 100644 --- a/core/modules/system/tests/fixtures/update/block.block.secondtestfor2354889.yml +++ b/core/modules/system/tests/fixtures/update/block.block.secondtestfor2354889.yml @@ -17,7 +17,7 @@ settings: label: Search provider: search label_display: visible - search_page: node_search + page_id: node_search cache: max_age: -1 status: true diff --git a/core/profiles/demo_umami/config/install/block.block.umami_search.yml b/core/profiles/demo_umami/config/install/block.block.umami_search.yml index dfc3d89bbe..4acc93c78e 100644 --- a/core/profiles/demo_umami/config/install/block.block.umami_search.yml +++ b/core/profiles/demo_umami/config/install/block.block.umami_search.yml @@ -16,5 +16,5 @@ settings: label: Search provider: search label_display: visible - search_page: node_search + page_id: node_search visibility: { } diff --git a/core/profiles/standard/config/install/block.block.bartik_search.yml b/core/profiles/standard/config/install/block.block.bartik_search.yml index f71bc8bf22..8a21f816dc 100644 --- a/core/profiles/standard/config/install/block.block.bartik_search.yml +++ b/core/profiles/standard/config/install/block.block.bartik_search.yml @@ -16,5 +16,5 @@ settings: label: Search provider: search label_display: visible - search_page: node_search + page_id: node_search visibility: { }