Merge branch 'MDL-49662_master' of git://github.com/markn86/moodle
[moodle.git] / lib / navigationlib.php
index 1675ae1..3bf5cc3 100644 (file)
@@ -3878,8 +3878,10 @@ class settings_navigation extends navigation_node {
         }
 
         //Add badges navigation
-        require_once($CFG->libdir .'/badgeslib.php');
-        badges_add_course_navigation($coursenode, $course);
+        if (!empty($CFG->enablebadges)) {
+            require_once($CFG->libdir .'/badgeslib.php');
+            badges_add_course_navigation($coursenode, $course);
+        }
 
         // Backup this course
         if (has_capability('moodle/backup:backupcourse', $coursecontext)) {