Permalink
Browse files

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

  • Loading branch information...
1 parent 415dd48 commit 8b4e28f87e5f918eda5b20ec85c036822134db5e @danmarsden danmarsden committed with nebgor Jan 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 calendar/lib.php
View
2 calendar/lib.php
@@ -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 8b4e28f

Please sign in to comment.