Closed (fixed)
Project:
Views Group By
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2009 at 21:30 UTC
Updated:
17 Apr 2009 at 16:50 UTC
If you try to group by tids you get this:
* user warning: Unknown column 'term_node_tid' in 'group statement' query: SELECT COUNT(*) FROM (SELECT COUNT( DISTINCT(node.nid)) AS nid, COUNT(node.nid) AS node_nid FROM node node WHERE node.type in ('richiesta') GROUP BY term_node_tid ORDER BY node_nid ASC ) count_alias in .../htdocs/sites/all/modules/views/includes/view.inc on line 705.
* user warning: Unknown column 'term_node_tid' in 'group statement' query: SELECT COUNT( DISTINCT(node.nid)) AS nid, COUNT(node.nid) AS node_nid FROM node node WHERE node.type in ('richiesta') GROUP BY term_node_tid ORDER BY node_nid ASC LIMIT 0, 10 in .../htdocs/sites/all/modules/views/includes/view.inc on line 731.
Query
SELECT COUNT(node.nid) AS nid,
COUNT(node.nid) AS node_nid
FROM node node
WHERE node.type in ('sometype')
GROUP BY term_node_tid
ORDER BY node_nid ASC
I think that you can group by term name but you cannot group by tids because the term id are always obtained in a separate query...
This is a shame because if you can group by tid you can get a filtered node count per term (but this is a problem in views module not in yours)
Comments
Comment #1
irakli commentedPlease install the new version of the module and see if the problem goes away.
Thank you
Comment #2
gunzip commentedit looks like the problem persists (i think it's structural and there isn't an easy way to get around that).
if you chose 'taxonomy: all terms' for fields you can't actually group by those ones because the query is
and the terms come from another query.
anyway you can circumvent this grouping by term name, selecting 'taxonomy: term' for fields
and then using a filter on the vocabulary.
Comment #3
irakli commentedPlease post the detailed description of your Views configuration: which fields do you have, which relationships etc. A screenshot would be great too.
Drupal Taxonomy integration with Views never exposes tid to Views, so I am not sure how did you manage to indicate that you wanted grouping by tid?