I am getting the following error with Drupal 4.7, event, event repeat, event_views, and JS calendar. The event views module doesn't seem to ever find any of the events in the database:
gmmktime() expects parameter 4 to be long, string given in C:\Program Files\xampp\htdocs\mysite\modules\event\event.module on line 248.
Also, based on a concurrent error, this might also relate to flexinode or the version of MySQL?:
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 '; 1149480660 + 0) AND (event.event_end < 1149912721 + 0) LIMIT 0, 10' at line 1 query: SELECT node.nid FROM node node WHERE (node.status = '1') AND (node.type IN ('event','flexinode-1','flexinode-13','flexinode-3','flexinode-6','flexinode-7','flexinode-18')) AND (event.event_start < 1149480660 + 0) AND (event.event_end < 1149912721 + 0) LIMIT 0, 10 in C:\Program Files\xampp\htdocs\mysite\includes\database.mysql.inc on line 120.
I get a lot of these errors when using event.views, etc. , but not with the plain old event and event repeat.
Comments
Comment #1
karens commentedI am wondering if it needs parantheses around things like
to make it
That bit of code is coming from the views_handler_filter_timestamp function in the views.module. If are where you can do it, try changing the following line in that module:
I'm not where I can post a patch or test this right now, but that may be what's needed. If you can't do it, I'll try testing that tomorrow...
Comment #2
karens commentedNevermind the above suggestion. I see that there needs to be a join to the event table that is missing in your query and it is a bug in the current cvs of the event_views module. I will be posting an updated event views module soon, and I'll make sure that fix is in there so you can test it.
Comment #3
karens commentedI an now replicate the problem. It happens if you create a view with no event fields and try to filter it using the jscalendar filter. The jscalendar filter is a generic filter from the views module that doesn't add a join to the event table, so I need to find a way to force it to do that. If you add an event field to the view, the problem will disappear because the field will set up the table join, it is just a problem if you don't add any event fields to the vew.
Anyway, you can get it working until I have a fix posted by adding an event field to your view.
Comment #4
bomarmonk commentedI'll give it a try. Thanks for tracking the problem down! Part user error, I would guess. However, I am using the default "event views" when I get this error. I need to edit the default views and add fields to them?
Comment #5
karens commentedThat's strange. The default views should all have fields in them. I'm getting ready to post an update in the next day or so anyway, so I'll confirm that the fields are in the default views, but they should be.
Comment #6
karens commentedThe latest version in cvs has the fix in it.
Comment #7
jwilde commentedHi Karen,
I'm getting the same sql errors as Bomarmonk using the 4.7 event views with event selector. I also tried the latest cvs and get the same errors as well as an array error on the links calendar. Any ideas what I might be doing incorrectly? I'm at wits end - help.
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 '; (1150796424 + 0)) AND (event.event_end > (1150796424 + 0))' at line 1 query: SELECT count(*) FROM node node LEFT JOIN event event ON node.nid = event.nid WHERE (node.status = '1') AND (node.type IN ('event')) AND (event.event_start > (1150796424 + 0)) AND (event.event_end > (1150796424 + 0)) in /home/test/public_html/test2/includes/database.mysql.inc on line 120.
Thanks,
Jim
Comment #8
bomarmonk commentedWell, I have it working now without errors: try installing the latest 4.7 version of the event module, including event.views (instead of CVS)
Comment #9
jwilde commentedThanks Bomarmonk. I tried those versions on a fresh install of 4.72 and continue to get errors.
Comment #10
karens commentedThe sql you posted looks valid and the join seems to be in there, so I don't know why you are getting errors. Do you have something like phpadmin where you can try to manually execute that sql and see what happens (by pasting the sql into a sql box). Also, can you export a copy of the view you are using and paste it here. Maybe there's something funky in your view.
Comment #11
karens commentedOne more thought. Look closely at your sql. Do you by any chance see sql that looks something like:
instead of
If so, this is the views bug reported at http://drupal.org/node/66928.
Comment #12
jwilde commentedThanks KarenS for all of your help! The sql was > instead of >. I applied your patch and it works great. Thanks again!
Jim
Comment #13
karens commentedThis ended up being a couple different bugs, but I think all are fixed except for the views bug which requires a patch to views and cannot be fixed in this module, so I am marking this issue fixed.