Affects Version/s: 3.6.8, 3.7.4, 3.8.1, 3.9
Covered by Behat tests:https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/4758/
Affected Branches:MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
Fixed Branches:MOODLE_37_STABLE, MOODLE_38_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
There is a problem with the single activity format.
If a person is enrolled in the course as a teacher and then the course format is set to Single Activity format in the settings, then after a short reload of the page an empty drop down box is displayed at type of activity.
Now I can save the activity and then the default value is taken and after saving I can create the activity.
And when I open the course settings afterwards, the type of activity is displayed.
If I do the same as an administrator or manager who has the role of manager (system roles) in Moodle, then everything will be displayed correctly and the user can select the type.
I have tested this behaviour on the Moodle sandbox and it is the same here.
Steps to reproduction:
1. create course
2. open course
3. enroll a normal user as a teacher in the course
4. login as previously enrolled user
5. open course setting
6. select the setting Single activity format on course format
Now the dropdown type of activity is empty
8. save the course
9. the activity to be created should now open
10. create and save activity
11. open course settings
Now the dropdown is no longer empty and the types of activity can be selected.
The problem would be caused by this commit:
If I would revert this one, then everything would work as expected.