Index: solr/project_solr.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/project/solr/project_solr.module,v retrieving revision 1.61 diff -U3 -r1.61 project_solr.module --- solr/project_solr.module 11 Aug 2009 21:40:08 -0000 1.61 +++ solr/project_solr.module 6 Sep 2009 01:39:07 -0000 @@ -174,24 +174,13 @@ return theme('item_list', $items); } -function project_solr_browse_page($term_name) { +/** + * The actual searching is done here. + */ +function project_solr_browse_search($parent_term = '') { try { - $output = ''; - - $parent_term = db_fetch_object(db_query("SELECT t.tid, t.name, t.description FROM {term_data} t WHERE t.vid = %d AND LOWER(t.name) = LOWER('%s')", _project_get_vid(), $term_name)); - - if (!$parent_term) { - // XXX: this is the Drupal 5 way... - return drupal_not_found(); - } - drupal_set_title(check_plain($parent_term->name)); - if (!empty($parent_term->description)) { - $output .= theme('project_type_description', $parent_term); - } - $text_query = isset($_GET['text']) ? $_GET['text'] : ''; $filters = isset($_GET['filters']) ? $_GET['filters'] : ''; - $sort = isset($_GET['solrsort']) ? check_plain($_GET['solrsort']) : ''; // Validate sort parameter @@ -230,7 +219,7 @@ // This hook allows modules to modify the query and params objects. apachesolr_modify_query($query, $params, 'project_solr'); if (!$query) { - return array(); + return NULL; } // Force sort to be by the corresponding core compatibility if filtered. @@ -245,7 +234,9 @@ // filters for the query -- project nodes of the given top-level type that // have releases (if project_release is enabled). $fq[] = 'type:project_project'; - $fq[] = 'im_vid_'. _project_get_vid() .':'. $parent_term->tid; + if (is_object($parent_term)) { + $fq[] = 'im_vid_'. _project_get_vid() .':'. $parent_term->tid; + } if (module_exists('project_release')) { $fq[] = 'is_project_has_releases:1'; } @@ -255,35 +246,61 @@ // The response is cached so that it is accessible to the blocks and anything // else that needs it beyond the initial search. - $total = $response->response->numFound; - - project_solr_response_cache(array($query, $response, $parent_term)); - - // Set breadcrumb - $breadcrumb = menu_get_active_breadcrumb(); - drupal_set_breadcrumb($breadcrumb); - - $output .= '