content_access 6.x-1.0-beta1 seems not working with views 2.2. When I specified a page view to be distinct, I got this query (after I installed the content_access too):
SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node_data_field_photo.field_photo_fid AS node_data_field_photo_field_photo_fid, node_data_field_photo.field_photo_list AS node_data_field_photo_field_photo_list, node_data_field_photo.field_photo_data AS node_data_field_photo_field_photo_data, node_data_field_photo.nid AS node_data_field_photo_nid, node.type AS node_type, node.title AS node_title, node_data_field_position.field_position_value AS node_data_field_position_field_position_value, node_data_field_position.nid AS node_data_field_position_nid, node_revisions.teaser AS node_revisions_teaser, node_revisions.format AS node_revisions_format FROM node node LEFT JOIN content_field_photo node_data_field_photo ON node.vid = node_data_field_photo.vid LEFT JOIN content_type_testimonial node_data_field_position ON node.vid = node_data_field_position.vid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE (node.status <> 0) AND (node.type in ('testimonial')) ORDER BY node_title ASC
The problem is here: DISTINCT(node.nid) AS DISTINCT(node.nid)
All my distinct views got this problem.
Comments
Comment #1
cscutcher commentedAlso experienced this problem. Everything works fine until I enable and rebuild the permissions for content access then i get the error;
My thanks to the previous poster for making the connection to distinct queries
Comment #2
fagocheck the views issue queue - as this is an issue of views once any node access related module is turned on - there is nothing content access can do about that, as drupal is modifying the queries of views for us.
So I set this issue to "by design".
Comment #3
ichsan commentedThis is Drupal's fault. I see this in IRC. Someone there give me this link http://drupal.org/node/284392
Comment #4
harry slaughtersee this patch: http://drupal.org/node/284392#comment-1049183