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.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1034006.patch | 836 bytes | jhodgdon |
Comments
Comment #1
jhodgdonHere'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.
Comment #2
YK85 commentedsubscribing
Comment #3
jhodgdonI just used this patch on another site that had this same problem. Any chance we could get it added to the Faceted Search module?
Comment #4
DalSegno commentedSubscribing
Comment #5
kristi wachter commentedThis fixed a similar problem for me.
(One term facet had a count of 16 nodes, but when you clicked the term, you got more than 40 results!)
It would be great to get this committed.
Thanks!
Comment #6
David Lesieur commentedCommitted, thanks!
Comment #7
David Lesieur commentedMarked #778712: Faceted Search returns wrong results after node's taxonomy has been edited as duplicate.