function apachesolr_search_search_box_form_submit in Apache Solr Search 6
Same name and namespace in other branches
- 5.2 apachesolr_search.module \apachesolr_search_search_box_form_submit()
- 6.3 apachesolr_search.module \apachesolr_search_search_box_form_submit()
- 6.2 apachesolr_search.module \apachesolr_search_search_box_form_submit()
Process a block search form submission.
See also
1 string reference to 'apachesolr_search_search_box_form_submit'
- apachesolr_search_form_search_block_form_alter in ./
apachesolr_search.module - Implementation of hook_form_[form_id]_alter().
File
- ./
apachesolr_search.module, line 899 - Provides a content search implementation for node content for use with the Apache Solr search application.
Code
function apachesolr_search_search_box_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_id = $form['form_id']['#value'];
$keys = $form_state['values'][$form_id];
// Handle Apache webserver clean URL quirks.
if (variable_get('clean_url', '0')) {
$keys = str_replace('+', '%2B', $keys);
}
$form_state['redirect'] = 'search/apachesolr_search/' . trim($keys);
}