Skip to content
Browse files

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

  • Loading branch information...
1 parent 20a903c commit 0ec75d9ffee0bbe3ab7f20718ac769bed1f3014f @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
@@ -1510,7 +1510,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 0ec75d9

Please sign in to comment.
Something went wrong with that request. Please try again.