Permalink
Browse files

MDL-37539 Assignment upgrade: Disable submission comments if allow no…

…tes was not enabled.

For advanced upload of files only - this setting was stored in var2.

Conflicts:

	mod/assign/submission/comments/locallib.php
  • Loading branch information...
1 parent c21089c commit 48410be6202f28a4280e782e7d856bfd00225847 @damyon damyon committed Jan 17, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod/assign/submission/comments/locallib.php
View
7 mod/assign/submission/comments/locallib.php
@@ -113,7 +113,12 @@ public function can_upgrade($type, $version) {
* @return bool was it a success? (false will trigger a rollback)
*/
public function upgrade_settings(context $oldcontext, stdClass $oldassignment, & $log) {
- // first upgrade settings (nothing to do)
+ if ($oldassignment->assignmenttype == 'upload') {
+ // Disable if allow notes was not enabled.
+ if (!$oldassignment->var2) {
+ $this->disable();
+ }
+ }
return true;
}

0 comments on commit 48410be

Please sign in to comment.