MDL-37539 Assignment upgrade: Disable submission comments if allow notes was not enabled.

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

Conflicts:

	mod/assign/submission/comments/locallib.php
This commit is contained in:
Damyon Wiese
2013-01-17 12:17:38 +08:00
parent 4c4ade1ca9
commit 508f42e2f1
+6 -1
View File
@@ -113,7 +113,12 @@ class assign_submission_comments extends assign_submission_plugin {
* @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;
}