Skip to content
Browse files

Merge branch 'MDL-37543-master' of git://github.com/damyon/moodle

  • Loading branch information...
2 parents cccdddf + 01d29b3 commit 5d4183b94fa63f39323b803ee6db4b1b7bd045a2 @nebgor nebgor committed Jan 22, 2013
Showing with 9 additions and 1 deletion.
  1. +9 −1 mod/assign/submission/file/locallib.php
View
10 mod/assign/submission/file/locallib.php
@@ -344,13 +344,21 @@ public function can_upgrade($type, $version) {
* @return bool Was it a success? (false will trigger rollback)
*/
public function upgrade_settings(context $oldcontext, stdClass $oldassignment, & $log) {
+ global $DB;
+
if ($oldassignment->assignmenttype == 'uploadsingle') {
$this->set_config('maxfilesubmissions', 1);
$this->set_config('maxsubmissionsizebytes', $oldassignment->maxbytes);
return true;
- } else {
+ } else if ($oldassignment->assignmenttype == 'upload') {
$this->set_config('maxfilesubmissions', $oldassignment->var1);
$this->set_config('maxsubmissionsizebytes', $oldassignment->maxbytes);
+
+ // Advanced file upload uses a different setting to do the same thing.
+ $DB->set_field('assign',
+ 'submissiondrafts',
+ $oldassignment->var4,
+ array('id'=>$this->assignment->get_instance()->id));
return true;
}
}

0 comments on commit 5d4183b

Please sign in to comment.
Something went wrong with that request. Please try again.