Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-37177 navigation: Prevent exception when viewing a profile

When viewing a profile as a non-authenticated user, an exception
was raised because we were trying to fetch the context of this user.
  • Loading branch information...
commit d422fb22f7bc6f9ad499ec375982bee331f50ce5 1 parent b3778a0
@FMCorz FMCorz authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  lib/navigationlib.php
View
3  lib/navigationlib.php
@@ -2157,8 +2157,7 @@ protected function load_for_user($user=null, $forceforcontext=false) {
$usernode->add(get_string('messages', 'message'), $url, self::TYPE_SETTING, null, 'messages');
}
- $context = context_user::instance($USER->id);
- if ($iscurrentuser && has_capability('moodle/user:manageownfiles', $context)) {
+ if ($iscurrentuser && has_capability('moodle/user:manageownfiles', context_user::instance($USER->id))) {
$url = new moodle_url('/user/files.php');
$usernode->add(get_string('myfiles'), $url, self::TYPE_SETTING);
}
Please sign in to comment.
Something went wrong with that request. Please try again.