diff --git c/core/modules/search/lib/Drupal/search/Controller/SearchController.php w/core/modules/search/lib/Drupal/search/Controller/SearchController.php index 8a6b0fd..f934f29 100644 --- c/core/modules/search/lib/Drupal/search/Controller/SearchController.php +++ w/core/modules/search/lib/Drupal/search/Controller/SearchController.php @@ -10,6 +10,7 @@ use Drupal\Core\Controller\ControllerBase; use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\search\SearchPluginManager; +use Drupal\search\Form\SearchForm; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; @@ -105,7 +106,7 @@ public function view(Request $request, $plugin_id = NULL, $keys = NULL) { } } // The form may be altered based on whether the search was run. - $build['search_form'] = drupal_get_form(SearchForm::create($this->container), $plugin_id); + $build['search_form'] = drupal_get_form(SearchForm::create($this->container()), $plugin_id); $build['search_results'] = $results; return $build; } diff --git c/core/modules/search/lib/Drupal/search/Form/SearchForm.php w/core/modules/search/lib/Drupal/search/Form/SearchForm.php index 090e044..9cd5187 100644 --- c/core/modules/search/lib/Drupal/search/Form/SearchForm.php +++ w/core/modules/search/lib/Drupal/search/Form/SearchForm.php @@ -3,9 +3,9 @@ * @file * Contains \Drupal\search\Form\SearchForm. */ +namespace Drupal\search\Form; use Drupal\Core\Form\FormBase; -use Drupal\Core\DependencyInjection\ContainerInjectionInterface; use Drupal\search\SearchPluginManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -37,7 +37,7 @@ public static function create(ContainerInterface $container) { * The search plugin manager. * */ - public function __construct(SearchInterface $search_plugin) { + public function __construct(SearchPluginManager $search_plugin) { $this->searchManager = $search_plugin; } @@ -51,7 +51,7 @@ public function getFormID() { /** * {@inheritdoc} */ - public function buildForm(array $form, array &$form_state, $plugin_id = NULL) { + public function buildForm(array $form, array &$form_state, $plugin_id = NULL, $action = '', $prompt = NULL) { $plugin = $this->searchManager->createInstance($plugin_id); $plugin_info = $plugin->getPluginDefinition(); @@ -62,7 +62,7 @@ public function buildForm(array $form, array &$form_state, $plugin_id = NULL) { $prompt = $this->t('Enter your keywords'); } - $form['#action'] = $this->getUrlGenerator()->generateFromPath($action); + $form['#action'] = $this->urlGenerator()->generateFromPath($action); // Record the $action for later use in redirecting. $form_state['action'] = $action; $form['plugin_id'] = array( @@ -101,14 +101,14 @@ public function buildForm(array $form, array &$form_state, $plugin_id = NULL) { /** * {@inheritdoc} */ - public function validateForm(array $form, array &$form_state) { + public function validateForm(array &$form, array &$form_state) { form_set_value($form['basic']['processed_keys'], trim($form_state['values']['keys']), $form_state); } /** * {@inheritdoc} */ - public function submitForm(array $form, array &$form_state) { + public function submitForm(array &$form, array &$form_state) { $keys = $form_state['values']['processed_keys']; if ($keys == '') { form_set_error('keys', t('Please enter some keywords.'));