I have a view with one table and one attachment display.
The table simply lists nodes of type "Newsletter issue", the attachment takes as an argument the creation year and shows a list of years (styled as tabs) above the table.
Except the argument of the attachment both view displays share the same default settings for fields (title, c.date), sort criteria (sticky, c.date) and filters (n.type, published, taxonomy term).
Worked very well for Views 6.x-2.2, but when I upgraded to 2.3 the attachment had no output anymore (the year tabs disapperad).
Using devel module I examined the SQL query of the attachment view:
(same type of view but lists story nodes)
SELECT EXTRACT(YEAR FROM((FROM_UNIXTIME(node.created) + INTERVAL 3600 SECOND))) AS created_year,
COUNT(DISTINCT(node.nid)) AS num_records
FROM d6_node node
LEFT JOIN d6_term_node term_node ON node.vid = term_node.vid AND term_node.tid != 40
WHERE (node.type in ('story')) AND (node.status <> 0) AND (term_node.tid = 40)
GROUP BY created_year
ORDER BY created_year DESC LIMIT 0, 10
The problem seems to be the constraint term_node.tid != 40 in the line of the LEFT JOIN.
Why does a "not equals" operator appear here??
I found that this problem only occurs when using the "is one of" handler in taxonomy term filter, so as a temporary workaround one can just use "is all of" when only one term is selected.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | home_news_events_highlights.txt | 18.27 KB | garryh |
Comments
Comment #1
merlinofchaos commentedI would need to see the view export in order to answer this question. Too many settings, etc.
Comment #2
andreiashu commented@mindgame: do you use Calendar Views ?
I'm not sure if this is because of Views or Calendar but i am getting the exact same behaviour with Calendar (I also get the "term_node.tid !=" ).
I reported it (exported view + actually ran queries) here #312963: Taxonomy id filter not working
Comment #3
andreiashu commentedSetting this as active, because I think i provided all the necessary info in that port. I don't think I should repost it here because as i said i'm not really sure who's fault is this: Calendar or Views (I incline to this it is Calendar's fault though).
Comment #4
merlinofchaos commentedI believe this was fixed as a part of #373155: Attachment display always empty for view with argument validated & changed with PHP code. (regression)
Comment #5
mindgame commented@andreiashu
No, I don't use Calendar views.
@merlinofchaos
If you tell me what you changed or at least in which file/function, I could check whether the fix of #373155 also solves my problem.
Comment #6
andreiashu commented@merlinofchaos
thanks !
@mindgame
I downloaded the latest dev snapshot of Views and it indeed fixes this problem.
Comment #7
merlinofchaos commentedmindgame: http://drupal.org/cvs?commit=172474
Comment #9
garryh commentedI can confirm that this is still an issue.
If and only if the attachment filter taxonomy term is the same as the block it is attached to, the attachment displays nothing. The workaround as described by mindgame is a huge help (Thanks!)
mindgame: 'I found that this problem only occurs when using the "is one of" handler in taxonomy term filter, so as a temporary workaround one can just use "is all of" when only one term is selected.'
View export attached.
Comment #10
garryh commentedComment #11
merlinofchaos commentedgarryh, are you re-opening this because you've checked the current -dev version, where the patch exists, and have confirmed that the fix did not help, or are you just checking the 2.3 version, where the bug is known to exist and are not attentive enough to realize that this is fixed?
Since you didn't change the version, I'm going to assume the latter, and I chide you for wasting my time.
Comment #12
mindgame commentedI'm currently using Views 2.5 and for me the workaround that I suggested above is not necessary anymore.
("is all of" can be set back to "is one of")