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

darren oh’s picture

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.

darren oh’s picture

Status: Active » Fixed

Fixed in CVS commit 71972.

csc4’s picture

Where can I find this release to download it? The 5 version doesn't seem to have changed since April?

darren oh’s picture

A development snapshot will be available tomorrow.

Anonymous’s picture

Status: Fixed » Closed (fixed)