mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
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:
parent
aba5f469f6
commit
b1cff118c7
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user