mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merge branch 'MDL-60669-master' of git://github.com/tobiasreischmann/moodle
This commit is contained in:
commit
2c3d8a06c8
1 changed files with 8 additions and 2 deletions
|
@ -168,8 +168,14 @@ class restore_forum_activity_structure_step extends restore_activity_structure_s
|
|||
$data->forum = $this->get_new_parentid('forum');
|
||||
$data->userid = $this->get_mappingid('user', $data->userid);
|
||||
|
||||
$newitemid = $DB->insert_record('forum_subscriptions', $data);
|
||||
$this->set_mapping('forum_subscription', $oldid, $newitemid, true);
|
||||
// Create only a new subscription if it does not already exist (see MDL-59854).
|
||||
if ($subscription = $DB->get_record('forum_subscriptions',
|
||||
array('forum' => $data->forum, 'userid' => $data->userid))) {
|
||||
$this->set_mapping('forum_subscription', $oldid, $subscription->id, true);
|
||||
} else {
|
||||
$newitemid = $DB->insert_record('forum_subscriptions', $data);
|
||||
$this->set_mapping('forum_subscription', $oldid, $newitemid, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue