Merge branch 'wip-MDL-31197-m23' of git://github.com/samhemelryk/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 31 Jan 2012 23:48:47 +0000 (00:48 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 31 Jan 2012 23:48:47 +0000 (00:48 +0100)
lib/moodlelib.php

index 52d2e5d..e4062fe 100644 (file)
@@ -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 .'/');
             }
         }