Skip to content

Commit

Permalink
MDL-39118 - mod_data: removed areamaxbytes option for uploading files…
Browse files Browse the repository at this point in the history
… and images.

Setting the maximum size for a file or picture field to the course upload limit
would send a value of 0 to the file picker. This patch checks for this 0 value
and handles it appropriately.
  • Loading branch information
abgreeve committed Apr 22, 2013
1 parent 3a8c438 commit e06d542
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion mod/data/field/file/field.class.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function display_add_field($recordid=0) {
$html .= '<input type="hidden" name="field_'.$this->field->id.'_file" value="'.$itemid.'" />'; $html .= '<input type="hidden" name="field_'.$this->field->id.'_file" value="'.$itemid.'" />';


$options = new stdClass(); $options = new stdClass();
$options->areamaxbytes = $this->field->param3;
$options->maxbytes = $this->field->param3; $options->maxbytes = $this->field->param3;
$options->maxfiles = 1; // Limit to one file for the moment, this may be changed if requested as a feature in the future. $options->maxfiles = 1; // Limit to one file for the moment, this may be changed if requested as a feature in the future.
$options->itemid = $itemid; $options->itemid = $itemid;
Expand Down
1 change: 0 additions & 1 deletion mod/data/field/picture/field.class.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ function display_add_field($recordid=0) {
$str .= '</noscript>'; $str .= '</noscript>';


$options = new stdClass(); $options = new stdClass();
$options->areamaxbytes = $this->field->param3;
$options->maxbytes = $this->field->param3; $options->maxbytes = $this->field->param3;
$options->maxfiles = 1; // Only one picture permitted. $options->maxfiles = 1; // Only one picture permitted.
$options->itemid = $itemid; $options->itemid = $itemid;
Expand Down

0 comments on commit e06d542

Please sign in to comment.