By pbland on
I'm having a problem intercepting a search submitted in the "Search form" block. I have a module my_module where I created this hook function:
my_module_search($op = 'search', $keys = NULL) {
switch ($op) {
case 'name':
// Label of the product search tab.
return t('Productl Search');
case 'search':
drupal_goto('node/101');
I was expecting whenever a search is submitted, it will be redirected to node/101, but it's not as the search is submitted and I get the search results page. However, I have a menu option that opens a custom search page and when this search page is executed from this submit:
$form['my_module_search']['submit'] = array(
'#type' => 'submit',
'#value' => 'Search'
);
Then I am redirected to node/101. Shouldn't I be able to capture a search conducted in the Drupal Search block?