Closed (fixed)
Project:
Event
Version:
5.x-2.x-dev
Component:
User interface
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
12 Apr 2005 at 15:47 UTC
Updated:
24 Apr 2005 at 07:00 UTC
Event nodes that have a start/end date of, say May 15, show up on the calendar on April 15, despite the fact that the page for the node does in fact display May. Oddly enough, on my personal login the display is correct, however on all the other usernames I've tried, this problem occurs.
Comments
Comment #1
keschrich commentedAfter a bit of debugging I've found that changing the line:
$result = db_query(db_rewrite_sql('SELECT n.nid FROM {event} e INNER JOIN {node} n USING (nid) WHERE n.status = 1 AND e.start > %d AND e.start < %d ORDER BY e.start'), $first, $last);in event.module to:
$result = db_query_range(db_rewrite_sql("SELECT n.nid, n.title, n.type, n.status, n.moderate, e.start FROM {node} n INNER JOIN {event} e USING (nid) WHERE n.status = 1 AND n.moderate = 0 AND e.start >= $time ORDER BY e.start"), 0, $limit);solves the problem, although (at least so far as I understand the db_rewrite_sql command...err..aka not at all) this may break compatibility with other database servers.
Comment #2
keschrich commented/me continues to be an idiot..
i pasted the wrong line, it should be changed to:
$result = db_query("SELECT n.nid FROM event AS e INNER JOIN node AS n USING (nid) WHERE n.status = 1 AND e.start > $first AND e.start < $last ORDER BY e.start");sorry about the discrepancy
Comment #3
(not verified) commentedThis looks like a bug in db_rewrite_sql(), because AFAICT the two queries are functionally identical. Should the issue be moved to the Drupal project?
(Note I have not confirmed this behavior myself)
Comment #4
crunchywelch commentedThis is an old query which has been rewritten several times, and i believe that db_rewrite has also had patches as well. I cannot reproduce this problem on my sandboxes, please reopen if you have more information and can reproduce this behaviour on the updated versions.