Project: moodle
Issue MDL-40062: Replace add_to_log with an event trigger - mod_forum
Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class. *mod/forum (24 calls)* /mod/forum/discuss.php:95: add_to_log($course->id, 'forum', 'move discussion', "discuss.php?d=$discussion->id", $discussion->id, $cmto->id); /mod/forum/discuss.php:107: add_to_log($course->id, 'forum', 'view discussion', "discuss.php?d=$discussion->id", $discussion->id, $cm->id); /mod/forum/subscribe.php:152: add_to_log($course->id, "forum", "unsubscribe", "view.php?f=$forum->id", $forum->id, $cm->id); /mod/forum/subscribe.php:177: add_to_log($course->id, "forum", "subscribe", "view.php?f=$forum->id", $forum->id, $cm->id); /mod/forum/markposts.php:85: add_to_log($course->id, "discussion", "mark read", "view.php?f=$forum->id", $d, $cm->id); /mod/forum/markposts.php:96: add_to_log($course->id, "forum", "mark read", "view.php?f=$forum->id", $forum->id, $cm->id); /mod/forum/markposts.php:103: // add_to_log($course->id, "forum", "mark unread", "view.php?f=$forum->id", $forum->id, $cm->id); /mod/forum/index.php:54: add_to_log($course->id, 'forum', 'view forums', "index.php?id=$course->id"); /mod/forum/index.php:183: add_to_log($course->id, 'forum', 'subscribeall', "index.php?id=$course->id", $course->id); /mod/forum/index.php:186: add_to_log($course->id, 'forum', 'unsubscribeall', "index.php?id=$course->id", $course->id); /mod/forum/settracking.php:63: add_to_log($course->id, "forum", "stop tracking", "view.php?f=$forum->id", $forum->id, $cm->id); /mod/forum/settracking.php:71: add_to_log($course->id, "forum", "start tracking", "view.php?f=$forum->id", $forum->id, $cm->id); /mod/forum/lib.php:742: add_to_log($course->id, 'forum', 'mail error', "discuss.php?d=$discussion->id#p$post->id", /mod/forum/lib.php:1040: add_to_log($course->id, 'forum', 'mail digest error', '', '', $cm->id, $userto->id); /mod/forum/user.php:65: add_to_log(($isspecificcourse)?$courseid:SITEID, "forum", "user report", 'user.php?'.$url->get_query_string(), $userid); /mod/forum/post.php:336: add_to_log($discussion->course, "forum", "delete discussion", /mod/forum/post.php:353: add_to_log($discussion->course, "forum", "delete post", $discussionurl, "$post->id", $cm->id); /mod/forum/post.php:454: add_to_log($discussion->course, "forum", "prune post", /mod/forum/post.php:682: add_to_log($course->id, "forum", "update post", /mod/forum/post.php:725: add_to_log($course->id, "forum", "add post", /mod/forum/post.php:772: add_to_log($course->id, "forum", "add discussion", /mod/forum/subscribers.php:57: add_to_log($course->id, "forum", "view subscribers", "subscribers.php?id=$forum->id", $forum->id, $cm->id); /mod/forum/view.php:131: add_to_log($course->id, "forum", "view forum", "view.php?id=$cm->id", "$forum->id", $cm->id); /mod/forum/view.php:133: add_to_log($course->id, "forum", "view forum", "view.php?f=$forum->id", "$forum->id"); /mod/forum/search.php:115: add_to_log($course->id, "forum", "search", "search.php?id=$course->id&search=".urlencode($search), $search);
Story points: 40