Download & Extend

Results from previous node revisions being returned

Project:Faceted Search
Version:6.x-1.0-beta2
Component:Taxonomy Facets
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Taxonomy facets is returning results from previous node revisions.

What I mean is that if I create a node and assign it some taxonomy values from a non-hierarchical vocabulary, and then save a new revision of the node with different taxonomy values, when I do a faceted search on that node, I get results as if all taxonomy terms from all revisions are still attached to that node.

The reason is that the query generated by taxonomy facets joins to the {term_node} table only on nid and doesn't include the revision ID of the node.

I'm making a patch... will attach shortly.

Comments

#1

Status:active» needs review

Here's a patch against 6.x-1.0-beta2, but I think it will also apply to HEAD. With this patch, my client's site is now working correctly.

Basically the patch just uses array('nid', 'vid') as the join condition in taxonomy_facet_category::build_results_query(), rather than just 'nid'.

Incidentally, it looks like the count queries were fine as they were, so you might see for instance that a certain facet was supposed to have 2 results, then when you clicked it you found 4 results on the screen.

AttachmentSize
1034006.patch 836 bytes

#2

subscribing

#3

I just used this patch on another site that had this same problem. Any chance we could get it added to the Faceted Search module?

#4

Subscribing