-
Bug
-
Resolution: Fixed
-
Critical
-
3.4.4, 3.5.1, 3.6
-
MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-63231-set-default-value-for-int-param-MOODLE_Master -
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.
Exception - Argument 1 passed to file_get_all_files_in_draftarea() must be of the type integer, null given, called in [dirroot]/lib/form/filemanager.php on line 336 |
|
More information about this error |
|
×Debug info:
|
Error code: generalexceptionmessage
|
×Stack trace:
|
line 767 of /lib/filelib.php: TypeError thrown |
line 336 of /lib/form/filemanager.php: call to file_get_all_files_in_draftarea() |
line 580 of /lib/formslib.php: call to MoodleQuickForm_filemanager->validateSubmitValue() |
line 526 of /lib/formslib.php: call to moodleform->validate_defined_fields() |
line 636 of /lib/formslib.php: call to moodleform->is_validated() |
line 156 of /course/edit.php: call to moodleform->get_data() |
Further Investigation
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.