Fix for navigation breaking when students have no view rights on one of the level one categories
This commit is contained in:
parent
0c459b9a8b
commit
c4966de6fd
|
@ -74,6 +74,12 @@ class webservicehelper {
|
|||
// Initialize parent if needed.
|
||||
if ($parent == null) {
|
||||
$parent = \core_course_category::user_top();
|
||||
|
||||
if ($parent == null) {
|
||||
// If the parent is still null, we do not have a valid user top.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (has_capability($capability, $parent->get_context())) {
|
||||
$list[] = $parent;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user