mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-33441 course/lib.php prevent fatal error when no visible categories
This commit is contained in:
parent
4db061680e
commit
7f88c42608
@ -2147,6 +2147,11 @@ function get_course_category_tree($id = 0, $depth = 0) {
|
||||
return array($categories, $categoryids);
|
||||
}
|
||||
|
||||
if (empty($categoryids)) {
|
||||
// No categories available (probably all hidden).
|
||||
return array();
|
||||
}
|
||||
|
||||
// The depth is 0 this function has just been called so we can finish it off
|
||||
|
||||
list($ccselect, $ccjoin) = context_instance_preload_sql('c.id', CONTEXT_COURSE, 'ctx');
|
||||
|
Loading…
x
Reference in New Issue
Block a user