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:
// 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!
Comments
Comment #1
darren ohI 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.
Comment #2
darren ohFixed in CVS commit 71972.
Comment #3
csc4 commentedWhere can I find this release to download it? The 5 version doesn't seem to have changed since April?
Comment #4
darren ohA development snapshot will be available tomorrow.
Comment #5
(not verified) commented