Skip to content
Snippets Groups Projects
Commit b6b2a164 authored by John Hoopes's avatar John Hoopes
Browse files

[UWMOODLE-634] Fixing empty course ids for getinorsql function so that if...

[UWMOODLE-634] Fixing empty course ids for getinorsql function so that if there are no local cowrses the block will still load.  
parent 46d98815
No related branches found
No related tags found
No related merge requests found
......@@ -154,11 +154,13 @@ function block_course_overview_uwmoodle_group_courses_by_term($courses) {
}
}
}
list ($insql, $inparams) = $DB->get_in_or_equal($courseids);
$select = "enrol='wisc' AND courseid $insql";
$enrols = $DB->get_records_select('enrol', $select, $inparams, '', 'id,courseid,customchar1');
foreach ($enrols as $enrol) {
$courseterms[$enrol->courseid][$enrol->customchar1] = true;
if(!empty($courseids)){
list ($insql, $inparams) = $DB->get_in_or_equal($courseids);
$select = "enrol='wisc' AND courseid $insql";
$enrols = $DB->get_records_select('enrol', $select, $inparams, '', 'id,courseid,customchar1');
foreach ($enrols as $enrol) {
$courseterms[$enrol->courseid][$enrol->customchar1] = true;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment