mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-77645 course: ensure active enrolments are considered for drawer.
Otherwise the enrolment index page tries to load the course index drawer, which doesn't exist at this point and triggers exceptions in the editor module. Co-authored-by: Tim Volckmann <tim.volckmann@mastersolution.com>
This commit is contained in:
parent
f29f757f5f
commit
0202597261
@ -3751,7 +3751,7 @@ function core_course_drawer(): string {
|
||||
}
|
||||
|
||||
// Show course index to users can access the course only.
|
||||
if (!can_access_course($PAGE->course)) {
|
||||
if (!can_access_course($PAGE->course, null, '', true)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
@ -102,3 +102,11 @@ Feature: Restricting access to course lists
|
||||
And I follow "Biology Y1"
|
||||
And I should see "You cannot enrol yourself in this course."
|
||||
And I log out
|
||||
|
||||
@javascript
|
||||
Scenario: Browse courses as a user who has a disabled enrolment in them
|
||||
Given the following "course enrolments" exist:
|
||||
| user | course | role | status |
|
||||
| usere | ENG1 | student | 1 |
|
||||
When I am on the "ENG1" course page logged in as usere
|
||||
Then I should see "You cannot enrol yourself in this course."
|
||||
|
Loading…
x
Reference in New Issue
Block a user