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 5132e88 commit 36d7050dedc55e8ef9d3441dc386970253a59790 @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 36d7050

Please sign in to comment.