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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user