Skip to content

Commit 9168eef

Browse files
committed
Bugfix: Course category breadcrumbs were broken on the course enrolment page due to MDL-80974 and were removed, resolves #727 (#728)
1 parent 7aaa86f commit 9168eef

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changes
66

77
### Unreleased
88

9+
* 2024-10-09 - Bugfix: Course category breadcrumbs were broken on the course enrolment page due to MDL-80974 and were removed, resolves #727.
910
* 2024-10-08 - Upstream change: Adopt change from MDL-82298 into smartmenus-[card|more]menu-children.mustache
1011
* 2024-08-11 - Updated Moodle Plugin CI to latest upstream recommendations
1112
* 2024-07-24 - Test: Fix broken Behat scenario 'Suppress 'Chat to course participants' link', resolves #696

classes/boostnavbar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ protected function prepare_nodes_for_boost(): void {
168168

169169
// Don't display the navbar if there is only one item. Apparently this is bad UX design.
170170
// Except, leave it in when in course context and categorybreadcrumbs are desired.
171-
if (get_config('theme_boost_union', 'categorybreadcrumbs') != THEME_BOOST_UNION_SETTING_SELECT_YES &&
172-
$this->page->context->contextlevel == CONTEXT_COURSE) {
171+
if (!(get_config('theme_boost_union', 'categorybreadcrumbs') == THEME_BOOST_UNION_SETTING_SELECT_YES &&
172+
$this->page->context->contextlevel == CONTEXT_COURSE)) {
173173
if ($this->item_count() <= 1) {
174174
$this->clear_items();
175175
return;

tests/behat/theme_boost_union_feelsettings_navigation.feature

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,18 @@ Feature: Configuring the theme_boost_union plugin for the "Navigation" tab on th
162162
| Category ED | 1 | CED | CE |
163163
| Category EDC | 2 | CEDC | CED |
164164
| Category EDCB | 3 | CEDCB | CEDC |
165-
| Category EDCBA | 4 | CEDCBA | CEDCB |
166165
And the following "courses" exist:
167166
| fullname | shortname | category |
168167
| Course C1 | CC1 | CE |
169168
| Course C2 | CC2 | CED |
170169
| Course C3 | CC3 | CEDC |
171170
| Course C4 | CC4 | CEDCB |
172-
| Course C5 | CC5 | CEDCBA |
173171
And the following "course enrolments" exist:
174172
| user | course | role |
173+
| teacher1 | CC1 | editingteacher |
175174
| teacher1 | CC2 | editingteacher |
176175
| teacher1 | CC3 | editingteacher |
177176
| teacher1 | CC4 | editingteacher |
178-
| teacher1 | CC5 | editingteacher |
179177
And the following config values are set as admin:
180178
| config | value | plugin |
181179
| categorybreadcrumbs | <setting> | theme_boost_union |
@@ -194,12 +192,6 @@ Feature: Configuring the theme_boost_union plugin for the "Navigation" tab on th
194192
And "Category ED" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
195193
And "Category EDC" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
196194
And "Category EDCB" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
197-
And I am on "Course C5" course homepage
198-
And "Category E" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
199-
And "Category ED" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
200-
And "Category EDC" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
201-
And "Category EDCB" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
202-
And "Category EDCBA" "link" <shouldornot> exist in the ".breadcrumb" "css_element"
203195

204196
Examples:
205197
| setting | shouldornot |
@@ -213,24 +205,17 @@ Feature: Configuring the theme_boost_union plugin for the "Navigation" tab on th
213205
| Category ED | 1 | CED | CE |
214206
And the following "courses" exist:
215207
| fullname | shortname | category |
216-
| Course C1 | CC1 | CE |
217-
| Course C2 | CC2 | CED |
208+
| Course C1 | CC1 | CED |
218209
And the following "course enrolments" exist:
219210
| user | course | role |
220-
| teacher1 | CC2 | editingteacher |
211+
| teacher1 | CC1 | editingteacher |
221212
And the following config values are set as admin:
222213
| config | value | plugin |
223214
| categorybreadcrumbs | yes | theme_boost_union |
224215
And "Course C1" has been set to one page per section
225-
And "Course C2" has been set to one page per section
226216
When I log in as "teacher1"
227217
And I am on section "1" page of "Course C1" course
228218
Then "Category E" "link" should exist in the ".breadcrumb" "css_element"
229-
And "Enrolment options" "text" should exist in the ".breadcrumb" "css_element"
230-
And "Enrolment options" "text" should appear after "Category E" "link" in the ".breadcrumb" "css_element"
231-
And "Topic 1" "link" should not exist in the ".breadcrumb" "css_element"
232-
And I am on section "1" page of "Course C2" course
233-
And "Category E" "link" should exist in the ".breadcrumb" "css_element"
234219
And "Category ED" "link" should exist in the ".breadcrumb" "css_element"
235220
And "Topic 1" "link" should exist in the ".breadcrumb" "css_element"
236221
And "Category ED" "link" should appear after "Category E" "link" in the ".breadcrumb" "css_element"

0 commit comments

Comments
 (0)