Index: opensearch.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/opensearch/opensearch.module,v retrieving revision 1.10.4.3 diff -u -r1.10.4.3 opensearch.module --- opensearch.module 4 Sep 2008 00:36:40 -0000 1.10.4.3 +++ opensearch.module 13 Jul 2009 20:45:39 -0000 @@ -156,7 +156,7 @@ * Implementation of hook_form_alter */ function opensearch_form_alter(&$form, $form_state, $form_id) { - if ($form_id == 'search_form' && arg(2)) { + if ($form_id == 'search_form' && (arg(2) || (arg(1) == 'apachesolr_search' && $_GET['filters']))) { // for pagination etc. $get = drupal_query_string_encode($_GET, array('q')); $form['basic']['inline']['rss'] = array('#type' => 'markup', '#value' => theme('xml_icon', url('opensearch/'. arg(1) .'/'. urlencode(search_get_keys()), array('query' => trim($get)?$get:NULL)))); @@ -167,6 +167,7 @@ * Menu callback; presents an opensearch results page. */ function opensearch_view() { + global $base_url; $type = arg(1); $keys = search_get_keys(); @@ -178,12 +179,26 @@ return drupal_not_found(); } + $display = FALSE; if (trim($keys)) { + $display = TRUE; + } + if ($type == 'apachesolr_search' && $_GET['filters']) { + $display = TRUE; + } + + if ($display) { // Log the search keys: watchdog('search', 'OpenSearch: %keys (@type).', array('%keys' => $keys, '@type' => module_invoke($type, 'search', 'name')), WATCHDOG_NOTICE, l(t('results'), 'search/'. $type .'/'. $keys)); // Collect the search results: - $results = check_plain(module_invoke($type, 'search', 'search', $keys)); + $results = module_invoke($type, 'search', 'search', $keys); + + if ($type == 'apachesolr_search') { + foreach ($results as $index => $result) { + $results[$index]['link'] = $base_url . $results[$index]['link']; + } + } return opensearch_feed($type, $keys, $results); }