Skip to content

Commit

Permalink
Revert "fix: redirect search to google (#1738)"
Browse files Browse the repository at this point in the history
This reverts commit 55e259c.
  • Loading branch information
aekong committed Jan 8, 2025
1 parent 55e259c commit 042dbba
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions web/modules/custom/sfgov_search/src/Form/GoogleSearchForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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(),
]);
}
}

0 comments on commit 042dbba

Please sign in to comment.