Permalink
Browse files

Merge branch 'MDL-37543-23' of git://github.com/damyon/moodle into MO…

…ODLE_23_STABLE
  • Loading branch information...
2 parents a932d0c + 5be632e commit c90b8f82a846ee20994391a7c87a97026b982dda @nebgor nebgor committed Jan 22, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 mod/assign/submission/file/locallib.php
@@ -302,14 +302,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 c90b8f8

Please sign in to comment.