diff --git a/web/modules/custom/sfgov_search/src/Form/GoogleSearchForm.php b/web/modules/custom/sfgov_search/src/Form/GoogleSearchForm.php index dc130e199..16fdfaefa 100644 --- a/web/modules/custom/sfgov_search/src/Form/GoogleSearchForm.php +++ b/web/modules/custom/sfgov_search/src/Form/GoogleSearchForm.php @@ -6,7 +6,6 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Language\LanguageManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -use Symfony\Component\HttpFoundation\RedirectResponse; class GoogleSearchForm extends FormBase { @@ -93,10 +92,8 @@ public function buildForm(array $form, FormStateInterface $form_state) { public function submitForm(array &$form, FormStateInterface $form_state) { $search = $form_state->getValues()['keys']; - $google_search_url = \Drupal\Core\Url::fromUri('https://www.google.com/search', [ - 'query' => ['q' => $search . ' site:sf.gov OR site:sfgov.org'], - ])->toString(); - $response = new RedirectResponse($google_search_url); - $response->send(); + $form_state->setRedirect('search.view_google_json_api_search', ['keys' => $search], [ + 'language' => $this->languageManager->getCurrentLanguage(), + ]); } }