Now forum-start tracking,

forum-mark read and
    forum-prune post
log actions are restored properly.
Part of bug 3582.
(http://moodle.org/bugs/bug.php?op=show&bugid=3852)

Merged from MOODLE_15_STABLE
This commit is contained in:
stronk7
2005-08-03 19:50:49 +00:00
parent f718493562
commit 98b8eba688
+37
View File
@@ -630,6 +630,28 @@
}
}
break;
case "mark read":
if ($log->cmid) {
//Get the new_id of the module (to recode the url and info fields)
$mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
if ($mod) {
$log->url = "view.php?f=".$mod->new_id;
$log->info = $mod->new_id;
$status = true;
}
}
break;
case "start tracking":
if ($log->cmid) {
//Get the new_id of the module (to recode the url and info fields)
$mod = backup_getid($restore->backup_unique_code,$log->module,$log->info);
if ($mod) {
$log->url = "view.php?f=".$mod->new_id;
$log->info = $mod->new_id;
$status = true;
}
}
break;
case "update":
if ($log->cmid) {
//Get the new_id of the module (to recode the info field)
@@ -748,6 +770,21 @@
}
}
break;
case "prune post":
if ($log->cmid) {
//Get the new_id of the post (to recode the url and info field)
$pos = backup_getid($restore->backup_unique_code,"forum_posts",$log->info);
if ($pos) {
//Get the post record from database
$dbpos = get_record("forum_posts","id","$pos->new_id");
if ($dbpos) {
$log->url = "discuss.php?d=".$dbpos->discussion;
$log->info = $pos->new_id;
$status = true;
}
}
}
break;
case "update post":
if ($log->cmid) {
//Get the new_id of the post (to recode the url and info field)