I enabled the event_views module 1.8.2.3 under Drupal 4.7.2 and then enabled the view "event_date"

Then when I go to http://test.cooldomain.com.com/event/date I get this error message:

* 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 ')))) FROM node node 
LEFT JOIN event event ON node.nid = event.nid WHERE 
(node.s' at line 1 query: SELECT count(DISTINCT(YEAR(from_UNIXTIME()))) 
FROM node node LEFT JOIN event event ON node.nid = event.nid 
WHERE (node.status = '1') AND (node.type IN ('event')) in
/var/www/html/includes/database.mysql.inc on line 120.

* 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 ')) AS event_year, 
count(DISTINCT(node.nid)) as num_nodes, node.title AS node_tit'
 at line 1 query: SELECT YEAR(from_UNIXTIME()) AS event_year, 
count(DISTINCT(node.nid)) as num_nodes, node.title AS node_title, 
node.changed AS node_changed, event.event_start AS 
event_event_start, event.event_end AS event_event_end 
FROM node node LEFT JOIN event event ON node.nid = event.nid 
WHERE (node.status = '1') AND (node.type IN ('event')) GROUP BY 
YEAR(from_UNIXTIME()) ORDER BY event.event_end ASC LIMIT
 0, 10 in /var/www/html/includes/database.mysql.inc on line 120.

Get same error with event/calendar

Curiously event/selector is fine.

Comments

karens’s picture

It turns out that the default view doesn't behave right if you just enable it and try to use it. Instead, leave it disabled and add the view (you'll see an error message about sorting on two fields so set one of the sorts to none). Then save the view and the view that you added and saved should work fine.

I will be posting a fix to the double default sort, but it turns out that that has no bearing on the problem. The default view won't work by being enabled, it has to be added. I don't know yet if this is a views issue or a module issue, but I will investigate further when I return from my trip.

karens’s picture

Status: Active » Fixed

Found the problem. It needed a default value which got set automatically if the view was added instead of enabled. Should be fixed in both cvs and 4.7 branches.

Anonymous’s picture

Status: Fixed » Closed (fixed)