Been banging my head with this one for a couple of days now. Trying to implement faceted search into our college site and am having trouble with no results being displayed when I click on a filter and a certain node is present within the results.
After clicking on the nodes taxonomy term the guided search block is telling me that there are 14 pages, 7 blog posts and 1 video to be displayed. If I add ?page=1 to the url I get the second page of results. I've trawled through the nodes being loaded via Drupal for Firebug and have pinpointed the node that is giving me problems. If I unpublish it the results display without issue. The node is a simple bit of php to display the latest blog post to be tagged with a certain taxonomy term.
$result = db_query("SELECT nid FROM node WHERE type = 'blog' ORDER BY created DESC");
$cont = true;
while(($row = db_fetch_object($result)) && ($cont == true)){
$blog_post = node_load($row->nid);
$taxonomys = taxonomy_node_get_terms($blog_post);
foreach($taxonomys as $taxonomy)
if($taxonomy->name == 'FE Campus'){
$output = node_show($blog_post,NULL);
print_r($output);
$cont = false;
}
}
I've checked all my logs and I'm not getting any errors coming back. All I've been able to discover is through the theme developer that theme_faceted_search_ui_stage_results() has an array that contains the results element with the expected results in it, but the results element of the theme_faceted_search_ui_page() contains the 'Your search yeilded no results...' info.
I've tried deleting and recreating the module, I've cleared all caches and rebuilt all indexes. I even added some intro text and stuck the teaser break before the code but no joy. This is the only issue I'm having with over 2000 nodes and any help will be appreciated.
Comments
Comment #1
salaDDodger commentedSeemed to have worked around whatever the problem was, changed the code to
replacing the node_show with a node_view and it appears to have solved the problem. Not sure what was causing it, node_show is used in similar situations (although never to display nodes with comments enabled which I believe is one of the differences in the methods) and displays fine in the faceted search results, and both display fine in the normal search results.
I think ultimately installing views and migrating all code like this to the views system would probably avoid issues like this.