Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.8.4
-
Fix Version/s: 1.9.1
-
Component/s: Assignment
-
Labels:None
-
Affected Branches:MOODLE_18_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
When an upload or uploadsingle assignment is set to use the course upload limit as its maximum size, the upload form displays "(Max size: 0 bytes)" since this is what the maxbytes attribute gets set to.
This could be fixed by changing:
$strmaxsize = get_string("maxsize", "", display_size($this->assignment->maxbytes));
in type/upload*/assignment.class.php to:
$strmaxsize = get_string("maxsize", "", display_size($this->assignment->maxbytes == 0 ? $this->course->maxbytes : $this->assignment->maxbytes));
A better fix may be to say:
$maxbytes = $this->assignment->maxbytes == 0 ? $this->course->maxbytes : $this->assignment->maxbytes;
at the top of view_upload_form() and use $maxbytes thereafter.