Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…hat are hidden or unavailable
  • Loading branch information...
commit dca3ade60f97f9e46283c98faa7bc7f2bf2d5958 1 parent 7547a5a
Sam Hemelryk samhemelryk authored wdjunaidi committed

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. +4 0 lib/moodlelib.php
4 lib/moodlelib.php
@@ -2775,6 +2775,10 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
2775 2775 if ($preventredirect) {
2776 2776 throw new require_login_exception('Course is hidden');
2777 2777 }
  2778 + // We need to override the navigation URL as the course won't have
  2779 + // been added to the navigation and thus the navigation will mess up
  2780 + // when trying to find it.
  2781 + navigation_node::override_active_url(new moodle_url('/'));
2778 2782 notice(get_string('coursehidden'), $CFG->wwwroot .'/');
2779 2783 }
2780 2784 }

0 comments on commit dca3ade

Please sign in to comment.
Something went wrong with that request. Please try again.