Closed (fixed)
Project:
Event
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2006 at 15:15 UTC
Updated:
2 Apr 2007 at 17:16 UTC
Jump to comment: Most recent file
I was just looking at the sql that builds the array of events in event_calendar_data() and it does not look like this sql statement is checking for non-moderated nodes. If this is handled somewhere else, please excuse the bug report. I just noticed this and thought I would ask about it before it becomes an issue for someone. Here is line 933 in the current 4.7 version of the module (v1.183.2.2 signed on 2006/03/28):
$result = db_query(db_rewrite_sql('SELECT n.nid, e.event_start FROM {node} n INNER JOIN {event} e ON n.nid = e.nid WHERE n.status = 1 AND ((e.event_start > %d AND e.event_start < %d) OR (e.event_end > %d AND e.event_end < %d) OR (e.event_start < %d AND e.event_end > %d)) ORDER BY event_start '), $first, $last, $first, $last, $first, $last);
Note that n.status = 1 is checked for, but n.moderate = 0 is not being checked for.
I tried creating an event and then checking "In moderation cue" and the node still shows up in the calendar.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | event_moderate_patch_0.txt | 3.47 KB | pwolanin |
Comments
Comment #1
pwolanin commentedYes, I just noticed this as well. The check for moderation is done is building the list for the block, but not the calendar or feeds:
I'll try to make a patch for this, since we want to let all members submit events, but to moderate them before they show.
Comment #2
pwolanin commentedpatch attached- only changes 3 SQL queries to require that "n.moderate = 0" for calendar display, RSS, or ical.
Tested with drupal 4.7.2, MySQL 4.1, PHP 4.4.
Comment #3
pwolanin commentedI've been using this patch on a live site with no problems- it solves the problem for us of how to allow more users to add to the (public) calendar while insuring that the evetns are relevant to the organization. Please review, since I think it's RTBC.
Comment #4
killes@www.drop.org commentedapplied to 4.7.
Comment #5
pwolanin commentedThanks- obviously there is no need to port it forward to 5.x.
Comment #6
(not verified) commented