mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-29350 Prevent duplication of groupings when copying activities
This patch also includes a database upgrade to correct data produced as a result of this bug.
This commit is contained in:
parent
6be90ce05f
commit
6336bd914a
3 changed files with 24 additions and 2 deletions
|
@ -802,7 +802,14 @@ class restore_groups_structure_step extends restore_structure_step {
|
|||
|
||||
$data->groupingid = $this->get_new_parentid('grouping'); // Use new parentid
|
||||
$data->groupid = $this->get_mappingid('group', $data->groupid); // Get from mappings
|
||||
$DB->insert_record('groupings_groups', $data); // No need to set this mapping (no child info nor files)
|
||||
|
||||
$params = array();
|
||||
$params['groupingid'] = $data->groupingid;
|
||||
$params['groupid'] = $data->groupid;
|
||||
|
||||
if (!$DB->record_exists('groupings_groups', $params)) {
|
||||
$DB->insert_record('groupings_groups', $data); // No need to set this mapping (no child info nor files)
|
||||
}
|
||||
}
|
||||
|
||||
protected function after_execute() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue