diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php index 347a127a768..f2c4532f9d4 100644 --- a/blocks/section_links/block_section_links.php +++ b/blocks/section_links/block_section_links.php @@ -47,8 +47,8 @@ class block_section_links extends block_base { return [ 'course-view-weeks' => true, 'course-view-topics' => true, - 'section-view-weeks' => true, - 'section-view-topics' => true, + 'course-view-section-weeks' => true, + 'course-view-section-topics' => true, ]; } diff --git a/course/format/classes/output/local/content/section/controlmenu.php b/course/format/classes/output/local/content/section/controlmenu.php index 3ae715f3e37..8b0d98fc711 100644 --- a/course/format/classes/output/local/content/section/controlmenu.php +++ b/course/format/classes/output/local/content/section/controlmenu.php @@ -166,7 +166,7 @@ class controlmenu implements named_templatable, renderable { $controls = []; // Only show the view link if we are not already in the section view page. - if ($PAGE->pagetype !== 'section-view-' . $course->format) { + if ($PAGE->pagetype !== 'course-view-section-' . $course->format) { $controls['view'] = [ 'url' => new moodle_url('/course/section.php', ['id' => $section->id]), 'icon' => 'i/viewsection', diff --git a/course/format/tests/behat/section_page.feature b/course/format/tests/behat/section_page.feature index 12a3dc07ab8..5234f8918df 100644 --- a/course/format/tests/behat/section_page.feature +++ b/course/format/tests/behat/section_page.feature @@ -100,3 +100,13 @@ Feature: Single section course page And I click on "View" "link" in the "Section 1" "section" When I set the field "Edit section name" in the "page-header" "region" to "Custom section name" Then "Custom section name" "text" should exist in the ".breadcrumb" "css_element" + + Scenario: Blocks are displayed in section page too + Given I log out + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | online_users | Course | C1 | course-view-* | site-pre | + When I am on the "C1" "Course" page logged in as "teacher1" + Then I should see "Online users" + And I am on the "Course 1 > Section 1" "course > section" page + And I should see "Online users" diff --git a/course/section.php b/course/section.php index 5db42bf9d81..0fe81a5b6e2 100644 --- a/course/section.php +++ b/course/section.php @@ -107,7 +107,7 @@ if (!$sectioninfo->uservisible) { } } -$PAGE->set_pagetype('section-view-' . $course->format); +$PAGE->set_pagetype('course-view-section-' . $course->format); $PAGE->set_other_editing_capability('moodle/course:update'); $PAGE->set_other_editing_capability('moodle/course:manageactivities'); $PAGE->set_other_editing_capability('moodle/course:activityvisibility'); diff --git a/theme/boost/classes/boostnavbar.php b/theme/boost/classes/boostnavbar.php index ad767af3dd4..bac700590ec 100644 --- a/theme/boost/classes/boostnavbar.php +++ b/theme/boost/classes/boostnavbar.php @@ -79,7 +79,7 @@ class boostnavbar implements \renderable { $this->remove($item->key, \breadcrumb_navigation_node::TYPE_CATEGORY); } // Remove the course breadcrumb node. - if (!str_starts_with($this->page->pagetype, 'section-view-')) { + if (!str_starts_with($this->page->pagetype, 'course-view-section-')) { $this->remove($this->page->course->id, \breadcrumb_navigation_node::TYPE_COURSE); } // Remove the navbar nodes that already exist in the secondary navigation menu.