datalib:get_courses_wmanagers() handle empty $CFG->coursemanager more gracefully

Having no roles set as coursemanager is a valid setting.
get_courses_wmanagers() should not produce invalid SQL on it...
actually, it should not even try to get the course managers.
This commit is contained in:
martinlanghoff 2007-09-19 07:54:23 +00:00
parent aba5f469f6
commit b1cff118c7

View File

@ -698,6 +698,11 @@ function get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=a
return array(); // no courses!
}
$CFG->coursemanager = trim($CFG->coursemanager);
if (empty($CFG->coursemanager)) {
return $courses;
}
$managerroles = split(',', $CFG->coursemanager);
$catctxids = '';
if (count($managerroles)) {