I have a problem with grouping my items with the 'Views Group By' module.

After testing the SQL query directly in my SQL database I learned that if I excluded some of the SQL query I ended up with the result that I needed.

It turnes out that the cause of my problem relates back to my 'language' module (my site is displayed in Danish). When I look at the SQL query I see that my system generates a node.language AS node_language. When I omit this line in my query - then everything works fine.

SELECT COUNT(node.nid) AS nid, 
term_data.name AS term_data_name, 
term_data.vid AS term_data_vid, 
term_data.tid AS term_data_tid, 
node_data_field_image_w_link.field_image_w_link_fid AS node_data_field_image_w_link_field_image_w_link_fid, 
node_data_field_image_w_link.field_image_w_link_list AS node_data_field_image_w_link_field_image_w_link_list, 
node_data_field_image_w_link.field_image_w_link_data AS node_data_field_image_w_link_field_image_w_link_data, 
node.language AS node_language, 
node.type AS node_type, 
node.vid AS node_vid 
FROM node node  
LEFT JOIN term_node term_node ON node.vid = term_node.vid 
LEFT JOIN term_data term_data ON term_node.tid = term_data.tid 
LEFT JOIN content_field_image_w_link node_data_field_image_w_link ON node.vid = node_data_field_image_w_link.vid 
WHERE node.type in ('imagegallery') 
GROUP BY term_data_name, 
node_data_field_image_w_link_field_image_w_link_fid, node_data_field_image_w_link_field_image_w_link_list, 
ORDER BY term_data_name ASC


Is there a way in which I can rearrange the SQL query code to omit the node.language AS node_language?




STNyborg’s picture

Would it be possible to hardcode a function in the views_groupby_handler_field_groupfields.inc file that removes the node.language line from the SQL query?

I know this is shortsighted and definitely not pretty coding, but I am running out of options...

Please help.


STNyborg’s picture

Status: Active » Closed (cannot reproduce)
nplowman’s picture

I'm experiencing this same problem. Will re-post if I find a solution.

nplowman’s picture

Issue summary: View changes

The request has not caught any remarks. Thus I have simplified the description.