mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
MDL-31197 navigation: Fixed issue withing require_login for courses that are hidden or unavailable
This commit is contained in:
parent
f6b4ec2b4a
commit
a0a39b0dcb
@ -2744,6 +2744,10 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
||||
if ($preventredirect) {
|
||||
throw new require_login_exception('Course is hidden');
|
||||
}
|
||||
// We need to override the navigation URL as the course won't have
|
||||
// been added to the navigation and thus the navigation will mess up
|
||||
// when trying to find it.
|
||||
navigation_node::override_active_url(new moodle_url('/'));
|
||||
notice(get_string('coursehidden'), $CFG->wwwroot .'/');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user