Skip to content

Commit c716fce

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 3845765 commit c716fce

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
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-24 - Upgrade: Update Bootstrap classes for Moodle 4.4.
1112
* 2024-08-11 - Updated Moodle Plugin CI to latest upstream recommendations

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 & 17 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,22 +205,16 @@ 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
When I log in as "teacher1"
225216
And I am on the "Course C1 > New section" "course > section" page
226217
Then "Category E" "link" should exist in the ".breadcrumb" "css_element"
227-
And "Enrolment options" "text" should exist in the ".breadcrumb" "css_element"
228-
And "Enrolment options" "text" should appear after "Category E" "link" in the ".breadcrumb" "css_element"
229-
And "New section" "link" should not exist in the ".breadcrumb" "css_element"
230-
And I am on the "Course C2 > New section" "course > section" page
231-
And "Category E" "link" should exist in the ".breadcrumb" "css_element"
232218
And "Category ED" "link" should exist in the ".breadcrumb" "css_element"
233219
And "New section" "link" should exist in the ".breadcrumb" "css_element"
234220
And "Category ED" "link" should appear after "Category E" "link" in the ".breadcrumb" "css_element"

0 commit comments

Comments
 (0)