From 646a7973b013b970d93ea396c4608b83a30f979f Mon Sep 17 00:00:00 2001 From: Huong Nguyen Date: Mon, 25 Apr 2022 09:50:39 +0700 Subject: [PATCH] MDL-74461 Navigation: Add section anchor to activity breadcrumb --- theme/boost/classes/boostnavbar.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/theme/boost/classes/boostnavbar.php b/theme/boost/classes/boostnavbar.php index fdd90df3f92..bd33f611b65 100644 --- a/theme/boost/classes/boostnavbar.php +++ b/theme/boost/classes/boostnavbar.php @@ -110,6 +110,13 @@ class boostnavbar implements \renderable { // given course format or the set course layout is not 'One section per page'. $removesections = !isset($courseformat->coursedisplay) || $courseformat->coursedisplay != COURSE_DISPLAY_MULTIPAGE; + if ($removesections) { + // If the course sections are removed, we need to add the anchor of current section to the Course. + $coursenode = $this->get_item($this->page->course->id); + if (!is_null($coursenode) && $this->page->cm->sectionnum !== null) { + $coursenode->action = course_get_format($this->page->course)->get_view_url($this->page->cm->sectionnum); + } + } } if ($this->page->context->contextlevel == CONTEXT_SYSTEM) { -- 2.11.4.GIT