Permalink
Browse files

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

…hat are hidden or unavailable
  • Loading branch information...
1 parent 7547a5a commit dca3ade60f97f9e46283c98faa7bc7f2bf2d5958 Sam Hemelryk committed with wdjunaidi Jan 20, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/moodlelib.php
View
@@ -2775,6 +2775,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 .'/');
}
}

0 comments on commit dca3ade

Please sign in to comment.