-
Improvement
-
Resolution: Won't Fix
-
Minor
-
1.9.9
-
None
-
Any
-
MOODLE_19_STABLE
-
MOODLE_20_STABLE
When courses are organised in to categories, one the user selects the course the category is no longer present in the breadcrumb links. This makes returning to the category level to select another course less intuitive.
To counter this issue, I have inserted the following code in the lib/weblib.php file in the function build_navigation section between the site info and course name:
// Categrory Name, if appropriate.
if (isset($COURSE->category) && $COURSE->id != SITEID) {
$categoryid = trim(get_string($COURSE->category),"[]");
$sql = "SELECT `name` FROM `mdl_course_categories` WHERE `id` = $categoryid";
$categoryname = get_record_sql($sql);
$navlinks[] = array(
'name' => format_string($categoryname->name),
'link' => "$CFG->wwwroot/course/category.php?id=$COURSE->category",
'type' => 'category');
}