mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-63798 mod_assign: fix restore when group is missing
This commit is contained in:
parent
56d8e413ba
commit
e35c7c2c50
1 changed files with 5 additions and 0 deletions
|
@ -167,6 +167,11 @@ class restore_assign_activity_structure_step extends restore_activity_structure_
|
||||||
}
|
}
|
||||||
if (!empty($data->groupid)) {
|
if (!empty($data->groupid)) {
|
||||||
$data->groupid = $this->get_mappingid('group', $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 {
|
} else {
|
||||||
$data->groupid = 0;
|
$data->groupid = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue