Permalink
Browse files

MDL-31086 Calendar : fix sql to get distinct list of courses

  • Loading branch information...
1 parent 8b1876f commit 72307d9a9f8858c2b3752a21e5ad5a0e4312fd34 @danmarsden danmarsden committed with nebgor Jan 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 calendar/lib.php
View
@@ -1351,7 +1351,7 @@ function calendar_get_default_courses() {
$courses = array();
if (!empty($CFG->calendar_adminseesall) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_SYSTEM))) {
list ($select, $join) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
- $sql = "SELECT c.* $select
+ $sql = "SELECT DISTINCT c.* $select
FROM {course} c
JOIN {event} e ON e.courseid = c.id
$join";

0 comments on commit 72307d9

Please sign in to comment.