Affects Version/s: 3.4.4, 3.5.1, 3.6
Affected Branches:MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
Fixed Branches:MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
Pull from Repository:
Pull Master Branch:
- Create a course with a teacher enrolled
Setup Create a course with a teacher enrolled Test Navigate to Site Administration|Users|Permissions Edit teacher role and uncheck: Change course summary (moodle/course:changesummary) capability Save changes Login as the teacher Access course Access course edit settings Perform some changes in settings like updating Course format from weekly to topics Save the changes. Confirm that you don't see any error message.
- Navigate to Site Administration|Users|Permissions
- Edit teacher role and uncheck: Change course summary (moodle/course:changesummary) capability
- Save changes
- Login as the teacher
- Access course
- Access course edit settings
- Perform some changes in settings like updating Course format from weekly to topics
- Save the changes.
- Confirm that you don't see any error message.
When a teacher tries to edit the course settings, it finds an exception when the teacher role does not have the moodle/course:changesummary capability. This capability is enabled by default but it is possible that some sites disabled it for some client policies.
This bug seems to be introduced by
MDL-62849 and the root of this problem is the type declaration defined in function file_get_all_files_in_draftarea. In this definition, it is forced to receive $draftitemid as an int value but for this scenario, $draftitemid is null causing the exception to the user. Before the change on MDL-62849, the function that did this process was file_get_drafarea_files that does not have any type declaration.