Hi. I created a view that had a taxonomy term name for an argument, and also a "taxonomy: term from X" as one of the filters. This caused no results to show up. I took a look at the query it actually generated:
SELECT node.nid, rand() AS random_sort
FROM {node} node
LEFT JOIN {term_node} term_node ON node.nid = term_node.nid
LEFT JOIN {term_hierarchy} term_hierarchy ON term_node.tid = term_hierarchy.tid
LEFT JOIN {term_data} term_data ON term_node.tid = term_data.tid
WHERE (node.type IN ('image')) AND (term_node.tid = '112') AND (term_data.name = 'Rocket To The Moon') ORDER BY random_sort ASC
It seems as though I'm looking for somethign that has BOTH the tid of 112 AND the name "rocket to the moon". There is no such element. The tid of 112 comes from the filter. The name of "Rocket To The Moon" comes from the argument.
The argument handler should be adding the term_node and term_data tables into the join again.
This patch does that.
Comments
Comment #1
Anonymous (not verified) commentedAnyone had a chance to look at this one yet?
Comment #2
vanvemdenSame problem here. Tried to apply the patch but got error (Hunk #1 FAILED at 394) on my file views_taxonomy.inc (// $Id: views_taxonomy.inc,v 1.27.2.12 2007/07/14 19:30:51 merlinofchaos Exp $) I'll try to make changes manually and will report back.
Comment #3
vanvemdenApplied patch manually and can confirm it solved the problem. Thanks, linuxbox, could not have done it myself! Sorry, can't give an expert opinion on the solution.
Comment #4
Anonymous (not verified) commentedI'd like to bump this bugfix one more time: What are the odds of this getting incorporated?
Comment #5
sunRequirements:
1) Coding style.
2) Marked as RTBC from another community member who applied and tested this patch.
3) At least one or two more confirmations by other community members that this patch in RTBC state works and does NOT conflict with other views.
Comment #6
BAJV commentedI cannot found the views_taxonomy.inc file. I wonder, is this patch applies to Views version 1 or Views version 2?
Thanks for any response.
Comment #7
tootsietorres commentedIs there a version of this patch for Views 2? Or another solution?
Thanks,
Tootsie
Comment #8
iainh commentedIf I "Select terms from vocabulary" and select a specific term, then the generated SQL is invalid; seems to miss the alias prefix from the "(.tid = 6)" in the WHERE clause.
Comment #9
esmerel commentedNo changes are being made to 1.x at this time.