Skip to content

Commit

Permalink
MDL-31086 Calendar : fix sql to get distinct list of courses
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden authored and Aparup Banerjee committed Feb 28, 2012
1 parent 415dd48 commit 8b4e28f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 8b4e28f

Please sign in to comment.