Skip to content

Commit

Permalink
MDL-29400 assignment: Require a file to be uploaded in form
Browse files Browse the repository at this point in the history
Don't display 'File uploaded successfully' when no file uploaded for
both upload and uploadsingle
  • Loading branch information
danpoltawski authored and Sam Hemelryk committed Mar 25, 2012
1 parent fa13450 commit 05d8d4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions mod/assignment/type/upload/upload_form.php
Expand Up @@ -28,6 +28,7 @@ function definition() {

// visible elements
$mform->addElement('filemanager', 'files_filemanager', get_string('uploadafile'), null, $instance['options']);
$mform->addRule('files_filemanager', get_string('uploadnofilefound'), 'required', null, 'client');

// hidden params
$mform->addElement('hidden', 'contextid', $instance['contextid']);
Expand Down
1 change: 1 addition & 0 deletions mod/assignment/type/uploadsingle/upload_form.php
Expand Up @@ -30,6 +30,7 @@ function definition() {
//$mform->addElement('filemanager', 'newfile', get_string('uploadafile'));
//$mform->addElement('filemanager', 'files_filemanager', get_string('uploadafile'), null, $instance['options']);
$mform->addElement('filepicker', 'assignment_file', get_string('uploadafile'), null, $instance['options']);
$mform->addRule('assignment_file', get_string('uploadnofilefound'), 'required', null, 'client');

// hidden params
$mform->addElement('hidden', 'contextid', $instance['contextid']);
Expand Down

0 comments on commit 05d8d4a

Please sign in to comment.