Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-31197 navigation: Fixed issue withing require_login for courses t…

…hat are hidden or unavailable
  • Loading branch information...
commit 9d2e41a6d75e4ec0bd1ce93fed83c7c64fadc868 1 parent 1aff7bb
Sam Hemelryk samhemelryk authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/moodlelib.php
4 lib/moodlelib.php
View
@@ -2499,6 +2499,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 .'/');
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.