-
Bug
-
Resolution: Fixed
-
Critical
-
1.9.15, 2.1.3, 2.2
-
XAMPP, Win 7
-
MOODLE_19_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_22_STABLE, MOODLE_23_STABLE
-
wip-mdl-30667
-
-
The course default settings page (Site admin > Courses > Course default settings) allows an admin to set the default maximum upload size for a course. The values used for this setting are drawn from an array in get_max_upload_sizes() and also, where it is not present in the array, from the $CFG->maxbytes, which is set at installation based on the upload_max_filesize set by PHP.
However, the site maximum upload, which defaults to the server maximum, is based on two variables post_max_size and upload_max_filesize. If these two values differ (when compared in the same scale) it chooses the lower, which, at least in XAMPP, is post_max_size.
So the difference between these two PHP variables causes a conflict which can be quite confusing.
Under the XAMPP defaults, when upload_max_filesize is 128MB (134217728 bytes) and post_max_size is 8MB, the course default settings page reports that the current value of the default course maximum upload size (moodlecourse | maxbytes) is invalid (see screen capture) because 128MB is not included in the list.
The initial value of $CFG->maxbytes should be set based on both post_max_size and upload_max_filesize. The site maximum describes that this is the case, so that's good, but the values lower in the hierarchy should clearly state the dependancies involved and what needs to be changed to correctly set a maximum.
Replication steps:
- Ensure the "Maximum uploaded file size" (maxbytes) setting at Site admin > Security > Site policies is set to "Server limit" (default)
- Check the value at Site admin > Courses > Course default settings
- Edit the php config and set post_max_size to 8M while upload_max_filesize is 128M
- Restart your server
- Check the value at Site admin > Courses > Course default settings (there may be an error reported at this stage)
- Save the default course values
- Edit the php config and set post_max_size to 128M while upload_max_filesize is 128M
- Check the value at Site admin > Courses > Course default settings (there may be an error reported at this stage)
- Save the default course values
- Possibly try other combinations so that $CFG->maxbytes does not appear in the list of options
- caused a regression
-
MDL-35454 installation and phpunit init regression caused by MDL-30667
- Closed
-
MDL-35517 When on the new course form I get a php warning
- Closed
- has been marked as being related by
-
MDL-27156 File System Repository files limited by PHP upload_max_filesize limits
- Closed
-
MDL-32674 Teacher Course file upload limit should be restricted by site limit rather than course limit
- Closed
- is duplicated by
-
MDL-34980 After upload_max_filesize and post_max_size are changed in php.ini, "Maximum Upload Size" in course settings displays incorrectly if previously set to the max server limit.
- Closed
- will help resolve
-
MDL-30612 Moodle 1.9.15 - "Advanced uploading of files" assignment has incorrect idea of course upload limit
- Closed