diff --git a/core/modules/search/src/Plugin/Block/SearchBlock.php b/core/modules/search/src/Plugin/Block/SearchBlock.php index e49c10312e..c5ebef12e9 100644 --- a/core/modules/search/src/Plugin/Block/SearchBlock.php +++ b/core/modules/search/src/Plugin/Block/SearchBlock.php @@ -66,7 +66,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition $this->formBuilder = $form_builder; $this->searchPageRepository = $search_page_repository; if (!$entity_type_manager) { - @trigger_error('Calling SearchBlock::__construct() without the $entity_type_manager argument is deprecated in drupal:8.8.0 and will be required before drupal:9.0.0. See https://www.drupal.org/node/3086824', E_USER_DEPRECATED); + @trigger_error('Calling SearchBlock::__construct() without the $entity_type_manager argument is deprecated in drupal:9.3.0 and is required before drupal:10.0.0. See https://www.drupal.org/node/3086824', E_USER_DEPRECATED); $entity_type_manager = \Drupal::service('entity_type.manager'); } $this->entityTypeManager = $entity_type_manager; diff --git a/core/modules/search/tests/src/Functional/SearchBlockTest.php b/core/modules/search/tests/src/Functional/SearchBlockTest.php index 1be7c1ed4d..17a6495af3 100644 --- a/core/modules/search/tests/src/Functional/SearchBlockTest.php +++ b/core/modules/search/tests/src/Functional/SearchBlockTest.php @@ -138,6 +138,17 @@ public function testSearchFormBlock() { $this->drupalGet('admin/structure/block/manage/' . $block->id()); $this->submitForm(['settings[page_id]' => 'user_search'], 'Save block'); + // Ensure search blocks that use a specific search page have a dependency on + // the search page configuration. + $block = \Drupal::entityTypeManager() + ->getStorage('block') + ->loadUnchanged($block->id()); + $this->assertSame([ + 'config' => ['search.page.user_search'], + 'module' => ['search'], + 'theme' => ['classy'], + ], $block->getDependencies()); + $name = $this->adminUser->getAccountName(); $this->drupalGet('node'); $this->submitForm(['keys' => $name], 'Search');