A SQL statement generated by Views produces the following. The problem seems to be SELECT DISTINCT(node.nid) AS DISTINCT(node.nid). If I change it to SELECT DISTINCT(node.nid) , that the View works.

Any idea why?

Thanks,

(It used to work. After upgrading from 6.9 to 6.10 and installed a few other must-have modules, the View corrupts)

SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node_data_field_ref_author.field_ref_author_value AS node_data_field_ref_author_field_ref_author_value, node_data_field_ref_author.nid AS node_data_field_ref_author_nid, node.type AS node_type, node.title AS node_title, node_data_field_ref_author.field_ref_pdf_fid AS node_data_field_ref_author_field_ref_pdf_fid, node_data_field_ref_author.field_ref_pdf_list AS node_data_field_ref_author_field_ref_pdf_list, node_data_field_ref_author.field_ref_pdf_data AS node_data_field_ref_author_field_ref_pdf_data, node_data_field_ref_author.field_ref_pubdate_value AS node_data_field_ref_author_field_ref_pubdate_value, node_data_field_ref_author.field_ref_link_url AS node_data_field_ref_author_field_ref_link_url, node_data_field_ref_author.field_ref_link_title AS node_data_field_ref_author_field_ref_link_title, node_data_field_ref_author.field_ref_link_attributes AS node_data_field_ref_author_field_ref_link_attributes FROM node node INNER JOIN content_field_ref_keyword node_data_field_ref_keyword ON node.vid = node_data_field_ref_keyword.vid LEFT JOIN content_type_reference node_data_field_ref_author ON node.vid = node_data_field_ref_author.vid WHERE (node.type in ('reference')) AND (node.status <> 0) AND (node_data_field_ref_keyword.field_ref_keyword_value = 'Capacity building') LIMIT 0, 10

Comments

karens’s picture

Status: Active » Fixed

That is a core bug when you use modules that have access control. See #284392: db_rewrite_sql causing issues with DISTINCT, Views can't do anything about this.

bigheadfish’s picture

Before I upgraded to 6.10 (was 6.9), it worked.

karens’s picture

It doesn't matter, the problem is the core bug I noted above.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.