Merged MDL-9606 from stable

This commit is contained in:
moodler 2007-04-27 06:30:21 +00:00
parent 1f21cc88f7
commit ca42eec162

View file

@ -1239,7 +1239,9 @@ function calendar_get_default_courses($ignoreref = false) {
// find all course this student can view // find all course this student can view
if ($allcourses = get_my_courses($USER->id, 'visible DESC, sortorder ASC', '*', true)) { if ($allcourses = get_my_courses($USER->id, 'visible DESC, sortorder ASC', '*', true)) {
foreach ($allcourses as $courseid => $acourse) { foreach ($allcourses as $courseid => $acourse) {
$context = get_context_instance(CONTEXT_COURSE, $courseid); if (!$context = get_context_instance(CONTEXT_COURSE, $courseid)) {
continue;
}
// let's try to see if there is any direct assignments on this context // let's try to see if there is any direct assignments on this context
// one can have multiple assignments // one can have multiple assignments
// just use anyone that has something, or else use empty string // just use anyone that has something, or else use empty string