This post is duplicate from http://drupal.org/node/464482

I am using date_browser to generate a page with upcomming events where the event nodes are presented. This works fine.

The I installed the module "content_access" to control the presentation of some content. I have some content that I only what to show to users with a higher access level. This works also fine except when I want to show my upcoming events page. Than I get the following error:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), node.title AS node_title, node_data_field_datum.field_' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node.title AS node_title, node_data_field_datum.field_body_value AS node_data_field_datum_field_body_value, node_data_field_datum.field_body_format AS node_data_field_datum_field_body_format, node.type AS node_type, node.vid AS node_vid, node_data_field_datum.field_datum_value AS node_data_field_datum_field_datum_value, node_data_field_datum.field_datum_value2 AS node_data_field_datum_field_datum_value2 FROM node node LEFT JOIN content_type_events node_data_field_datum ON node.vid = node_data_field_datum.vid WHERE ((node.status <> 0) AND (node.type in ('events'))) AND (DATE_FORMAT(ADDTIME(STR_TO_DATE(node_data_field_datum.field_datum_value, '%Y-%m-%dT%T'), SEC_TO_TIME(7200)), '%Y-%m-%d') >= '2009-05-16') ORDER BY node_data_field_datum_field_datum_value ASC in /var/www/drupal/modules/contrib/views/includes/view.inc on line 735.

When I disable the "content_access" module my upcoming event page works fine again. So I am sure it's the combination between the module "content_access" and view "date_browser".

All other calender views works OK. It doesn't make any different is content_access is ON or OFF.

To create my event items I created a content type "Kalender Item" with 2 extra field: fiend_body and field_datum.

I am searching for a solution for the hole day now. I cant find it. I am really stuck. Any help is welcome.

Comments

cglusky’s picture

you might want to have a look here since i see SELECT DISTINCT in the query #284392: db_rewrite_sql causing issues with DISTINCT

there is a patch there and they need help testing. access control and views appears to create issues with core db_rewrite_sql.

r,
coby

neorg’s picture

Status: Active » Closed (fixed)

Thanks Coby,

That was the solution.
Problem SOLVED

I will close this issue