Moodle

Incorrect max size shown when using course upload limit

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor 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));

Activity

Hide
Jason Meinzer added a comment -

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.

Show
Jason Meinzer added a comment - 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.
Hide
Petr Škoda (skodak) added a comment -

fixed in cvs, thanks for the report

Show
Petr Škoda (skodak) added a comment - fixed in cvs, thanks for the report
Hide
Eloy Lafuente (stronk7) added a comment -

Verified. Closing.

Show
Eloy Lafuente (stronk7) added a comment - Verified. Closing.

People

Dates

  • Created:
    Updated:
    Resolved: