Events Duplicated in Group Events Block
SomebodySysop - May 23, 2007 - 19:09
| Project: | OG Calendar |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
I ran into a problem where events displayed in the "Group events" block were duplicated several times. I resolved the problem by making one small change to og_calendar_block:
<?php
// Modification 2007-05-23 - Added "DISTICT" in order to avoid duplicates:
$sql = "SELECT DISTINCT e.nid FROM {event} e INNER JOIN {node} n ON n.nid = e.nid WHERE e.event_start >= %d ORDER BY e.event_start";
?>I simply added "DISTINCT" to the $sql, and that resolved the problem.
My question is: Was "DISTINCT" not put in originally by design, and if so, what are the ramifications of me adding it? If not, then could it be added to the code to avoid this sort of problem in the future?
Thanks!

#1
I think the problem is that we're using the nid instead of the vid. This should be fixed, since adding DISTINCT would not ensure that we load the latest version. Unfortunately, I will be unavailable for Drupal work until mid-August.
#2
Fixed in CVS commit 71972.
#3
Where can I find this release to download it? The 5 version doesn't seem to have changed since April?
#4
A development snapshot will be available tomorrow.
#5