Permalink
Browse files

MDL-37540 Assignment upgrade: Upgrade setting "Hide description befor…

…e due date"

Advanced upload of files has this setting which is stored in var3.
  • Loading branch information...
1 parent 5be632e commit f20d185c87d18afa0b3fc864e9aca74742965276 @damyon damyon committed Jan 17, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 mod/assign/submission/file/locallib.php
@@ -316,6 +316,16 @@ public function upgrade_settings(context $oldcontext,stdClass $oldassignment, &
'submissiondrafts',
$oldassignment->var4,
array('id'=>$this->assignment->get_instance()->id));
+
+ // Convert advanced file upload "hide description before due date" setting.
+ $alwaysshow = 0;
+ if (!$oldassignment->var3) {
+ $alwaysshow = 1;
+ }
+ $DB->set_field('assign',
+ 'alwaysshowdescription',
+ $alwaysshow,
+ array('id'=>$this->assignment->get_instance()->id));
return true;
}

0 comments on commit f20d185

Please sign in to comment.