-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.2
-
MOODLE_401_STABLE
-
MOODLE_401_STABLE, MOODLE_402_STABLE
-
MDL-77645-401 -
I figured out that there's a bug in (at least) Moodle 4.1.2 which occurs when I do the following:
- Create a course
- Enrol a student to a course
- Disable the enrolment method
- Try to open the course page as student
- The page is rendered correctly, but in the console of the browser, the following exception occurs:
I also wrote a small Behat script that helps to reproduce / cover this scenario:
@javascript @enrolment_test |
Feature: title
|
In order to value
|
As a role
|
I want feature Scenario: Test
|
Given the following "users" exist: |
| username | firstname | lastname |
|
| student | Student | 1 | |
And the following "courses" exist: |
| fullname | shortname |
|
| Course 1 | C1 | |
And I log in as "admin" |
And I am on "Course 1" course homepage |
And I navigate to course participants
|
And I enrol "Student 1" user as "Student" |
And I am on the "Course 1" "Enrolment methods" page |
And I click on "Disable" "icon" in the "Manual enrolments" "table_row" |
Then I log out
|
And I log in as "student" |
And I am on "Course 1" course homepage |
Then I should see "You cannot enrol yourself in this course." |
When you run this scenario, Behat finally fails with the following error (because of the exception):
Javascript code and/or AJAX requests are not ready after 10 seconds. There is a Javascript error or the code is extremely slow (core/reactive:registerInstance1:core_courseformat/placeholder:loadcourseindex:core/reactive:registerComponent3:core/reactive:registerComponent5). If you are using a slow machine, consider setting $CFG->behat_increasetimeout. (Exception) |