After i upgraded the Events (and Events Views) module to 5.x.-2.x-dev, my "Events today block" view doesn't work anymore. The filter in this view is set to Start Day ='now', Start Month='now' and Start Year='now' (plus two other, non-event filters). On execution I receive following 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 '10:31)) LIMIT 0, 10' at line 1 query: SELECT DISTINCT(node.nid), node.title AS node_title, node.changed AS node_changed, event.event_start AS event_event_start, event.event_end AS event_event_end, event.timezone AS event_timezone FROM dp_node node LEFT JOIN dp_workflow_node workflow_node ON node.nid = workflow_node.nid LEFT JOIN dp_event event ON node.nid = event.nid LEFT JOIN dp_content_field_locatie node_data_field_locatie ON node.vid = node_data_field_locatie.vid WHERE (node.type IN ('contenttype1','contenttype2')) AND (workflow_node.sid = '19') AND (MONTH(event.event_start) = MONTH(2008-01-24 10:31)) LIMIT 0, 10 in /includes/database.mysql.inc on line 172

I cleared both the site cache and the Views cache, but that didn't help. When I change the filter to Start Year=2008, Start Month=January and Start Day=24, the vieuw correctly shows the events of that date

Comments

principessaDS’s picture

Try changing lines 238-240 in event_views.module from

    case '***CURRENT_DATETIME***':
      $compare = strtoupper($filterinfo['type']) ."($filter[value])";
      break;

to

    case '***CURRENT_DATETIME***':
      $compare = strtoupper($filterinfo['type']) ."('$filter[value]')";
      break;
Digivonity’s picture

Thanks for the suggestion. It solved the problem!

cor3huis’s picture

Version: » 6.x-2.x-dev
Status: Active » Closed (fixed)

BTW better also use "drupal_strtoupper"