Events appear twice in the event calendar - with fix

Dru - September 26, 2004 - 01:01
Project:Event
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

HI,
I had a problem with events appearing twice on the event calendar, this happens only when you use the node_access module.
The problem is that when you start putting data into the node_access table, the query looking for events (event.module line 593) may result in a node id appearing more than once (it happens with the node_access_example module).
A simple solution was to put a DISTINCT atribute on the select, changing the line to -
$result = db_query('SELECT DISTINCT(n.nid) FROM {event} e INNER JOIN {node} n USING (nid) '. node_access_join_sql() .' WHERE '. node_access_where_sql() .' AND n.status = 1 AND e.start > %d AND e.start < %d ORDER BY e.start', $first, $last);

I guess a similar fix might be needed at line 1005.

#1

killes@www.drop.org - September 26, 2004 - 01:39

Thanks, fixed in cvs.

#2

Anonymous - October 10, 2004 - 02:20
 
 

Drupal is a registered trademark of Dries Buytaert.