I get this after installing (then removing) the node_privacy_byrole module:

This appears on my news page ONLY when I log out and access it as a non-registered user:

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 'HAVING (event_start >= '2008-02-01 00:00:00' AND event_start <= '2008-02-29 23:5' at line 1 query: SELECT DISTINCT(n.nid), n.uid, n.title, n.type, e.event_start, e.event_start AS event_start_orig, e.event_end, e.event_end AS event_end_orig, e.timezone, e.has_time, e.has_end_date, tz.offset AS offset, tz.offset_dst AS offset_dst, tz.dst_region, tz.is_dst, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND AS event_start_utc, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND AS event_end_utc, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL 0 SECOND AS event_start_user, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL 0 SECOND AS event_end_user, e.event_start - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL -21600 SECOND AS event_start_site, e.event_end - INTERVAL IF(tz.is_dst, tz.offset_dst, tz.offset) HOUR_SECOND + INTERVAL -21600 SECOND AS event_end_site, tz.name as timezone_name FROM node n INNER JOIN event e ON n.nid = e.nid INNER JOIN event_timezones tz ON tz.timezone = e.timezone INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( n.status = 1 AND ((e.event_start >= '2008-01-31 00:00:00' AND e.event_start <= '2008-03-01 23:59:59') OR (e.event_end >= '2008-01-31 00:00:00' AND e.event_end <= '2008-03-01 23:59:59') OR (e.event_start <= '2008-01-31 00:00:00' AND e.event_end >= '2008-03-01 23:59:59')) HAVING (event_start >= '2008-02-01 00:00:00' AND event_start <= '2008-02-29 23:59:59') OR (event_end >= '2008-02-01 00:00:00' AND event_end <= '2008-02-29 23:59:59') OR (event_start <= '2008-02-01 00:00:00' AND event_end >= '2008-02-29 23:59:59') )ORDER BY event_start ASC in /home/chichog8/public_html/widowssonschicago/modules/event/event_database.mysqli.inc on line 102.

Comments

Jerzabek’s picture

Same problem here.. :(

jotik’s picture

Here too. I'm not sure whether it happened before, but I first noticed it right after enabling the Internationalization module.

edwardrapley’s picture

Same here, only appears when i am logged out not when i am logged in.

lordmaji’s picture

Yeah, I'm having the same issue. I can't seem to figure it out either. :(

lordmaji’s picture

Priority: Normal » Critical
pobster’s picture

The problem is that db_rewrite has been altered to remove support for 'HAVING' in db queries. This only usually becomes a problem when something tries to rewrite the event modules query (such as the acl/ node_privacy modules).

Edit #1: the reason you're not having the issue when you're logged in is because access control doesn't apply to the superuser (user 1) so the query isn't rewritten. All your users will have the error though... Logged in or anonymous...

A quick fix is to remove the db_rewrite_sql calls in event_database.mysqli.inc (or whatever sql program you're using). Obviously it's not ideal, but well it's easier than rewriting the sql query to not include 'HAVING', which I've no idea how to do...

Edit #2: Okay so that's not a quick fix either... I'll look into this seeing as the maintainers don't give a toss.

Pobster

pobster’s picture

Status: Active » Closed (duplicate)

Best to keep things all in one place;

http://drupal.org/node/222128