You are here

function fuzzysearch_form_submit in Fuzzy Search 6

Redirect to callback with keys so that the search can be linked to.

1 string reference to 'fuzzysearch_form_submit'
fuzzysearch_box_form in ./fuzzysearch.module
Form to search the index

File

./fuzzysearch.module, line 560
Module file for fuzzysearch module.

Code

function fuzzysearch_form_submit($form, &$form_state) {

  // The search form relies on control of the redirect destination for its
  // functionality, so we override any static destination set in the request,
  // for example by drupal_access_denied() or drupal_not_found()
  // (see http://drupal.org/node/292565).
  if (isset($_REQUEST['destination'])) {
    unset($_REQUEST['destination']);
  }
  if (isset($_REQUEST['edit']['destination'])) {
    unset($_REQUEST['edit']['destination']);
  }
  $form_state['redirect'] = variable_get('fuzzysearch_path_name', 'fuzzysearch/results') . '/' . $form_state['values']['keys'];
}