Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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)
  • Loading branch information...
commit 14f03b6f8b0be78f25bc3f2d778bd59e140afe89 1 parent d65d9f9
stronk7 authored
Showing with 37 additions and 0 deletions.
  1. +37 −0 mod/forum/restorelib.php
View
37 mod/forum/restorelib.php
@@ -630,6 +630,28 @@ function forum_restore_logs($restore,$log) {
}
}
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 @@ function forum_restore_logs($restore,$log) {
}
}
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)
Please sign in to comment.
Something went wrong with that request. Please try again.