Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-26528_restore_forum_read' of git://github.com/stron…

…k7/moodle into MOODLE_19_STABLE
  • Loading branch information...
commit 9044a8edb32b2476bc7cba9993aec766695884eb 2 parents 86a8740 + 9170eb5
@stronk7 stronk7 authored
Showing with 5 additions and 10 deletions.
  1. +5 −10 mod/forum/restorelib.php
View
15 mod/forum/restorelib.php
@@ -385,15 +385,12 @@ function forum_read_restore_mods($forum_id,$info,$restore) {
$read->firstread = backup_todb($rea_info['#']['FIRSTREAD']['0']['#']);
$read->lastread = backup_todb($rea_info['#']['LASTREAD']['0']['#']);
- //Some recoding and check are performed now
- $toinsert = true;
-
//We have to recode the userid field
$user = backup_getid($restore->backup_unique_code,"user",$read->userid);
if ($user) {
$read->userid = $user->new_id;
} else {
- $toinsert = false;
+ continue; // Skip this forum_read record
}
//We have to recode the discussionid field
@@ -401,7 +398,7 @@ function forum_read_restore_mods($forum_id,$info,$restore) {
if ($discussion) {
$read->discussionid = $discussion->new_id;
} else {
- $toinsert = false;
+ continue; // Skip this forum_read record
}
//We have to recode the postid field
@@ -409,14 +406,12 @@ function forum_read_restore_mods($forum_id,$info,$restore) {
if ($post) {
$read->postid = $post->new_id;
} else {
- $toinsert = false;
+ continue; // Skip this forum_read record
}
- //The structure is equal to the db, so insert the forum_read
+ // Arrived here, the structure is equal to the db, so insert the forum_read
$newid = 0;
- if ($toinsert) {
- $newid = insert_record ("forum_read",$read);
- }
+ $newid = insert_record ("forum_read",$read);
//Do some output
if (($i+1) % 50 == 0) {
Please sign in to comment.
Something went wrong with that request. Please try again.