Skip to content

Commit

Permalink
MDL-63798 mod_assign: fix restore when group is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
davosmith committed Nov 21, 2018
1 parent 0225ad4 commit b5f63b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mod/assign/backup/moodle2/restore_assign_stepslib.php
Expand Up @@ -167,6 +167,11 @@ protected function process_assign_submission($data) {
}
if (!empty($data->groupid)) {
$data->groupid = $this->get_mappingid('group', $data->groupid);
if (!$data->groupid) {
// If the group does not exist, then the submission cannot be viewed and restoring can
// violate the unique index on the submission table.
return;
}
} else {
$data->groupid = 0;
}
Expand Down

0 comments on commit b5f63b1

Please sign in to comment.