From 6c63574607fdb6bd25d05b8fe77124a1a1023a20 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 19 Jan 2017 13:43:50 +0800 Subject: [PATCH] MDL-57639 mod_forum: Removed unused $forum param from tp function --- mod/forum/lib.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 79168f557cd..8000e7975c8 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3499,7 +3499,7 @@ function forum_print_post($post, $discussion, $forum, &$cm, $course, $ownpost=fa // Mark the forum post as read if required if ($istracked && !$CFG->forum_usermarksread && !$postisread) { - forum_tp_mark_post_read($USER->id, $post, $forum->id); + forum_tp_mark_post_read($USER->id, $post); } if ($return) { @@ -4393,7 +4393,7 @@ function forum_add_new_post($post, $mform, $unused = null) { $DB->set_field("forum_discussions", "usermodified", $post->userid, array("id" => $post->discussion)); if (forum_tp_can_track_forums($forum) && forum_tp_is_tracked($forum)) { - forum_tp_mark_post_read($post->userid, $post, $post->forum); + forum_tp_mark_post_read($post->userid, $post); } // Let Moodle know that assessable content is uploaded (eg for plagiarism detection) @@ -4458,7 +4458,7 @@ function forum_update_post($newpost, $mform, $unused = null) { forum_add_attachment($post, $forum, $cm, $mform); if (forum_tp_can_track_forums($forum) && forum_tp_is_tracked($forum)) { - forum_tp_mark_post_read($USER->id, $post, $post->forum); + forum_tp_mark_post_read($USER->id, $post); } // Let Moodle know that assessable content is uploaded (eg for plagiarism detection) @@ -4536,7 +4536,7 @@ function forum_add_discussion($discussion, $mform=null, $unused=null, $userid=nu } if (forum_tp_can_track_forums($forum) && forum_tp_is_tracked($forum)) { - forum_tp_mark_post_read($post->userid, $post, $post->forum); + forum_tp_mark_post_read($post->userid, $post); } // Let Moodle know that assessable content is uploaded (eg for plagiarism detection) @@ -6202,9 +6202,12 @@ function forum_tp_add_read_record($userid, $postid) { /** * If its an old post, do nothing. If the record exists, the maintenance will clear it up later. * + * @param int $userid The ID of the user to mark posts read for. + * @param object $post The post record for the post to mark as read. + * @param mixed $unused * @return bool */ -function forum_tp_mark_post_read($userid, $post, $forumid) { +function forum_tp_mark_post_read($userid, $post, $unused = null) { if (!forum_tp_is_post_old($post)) { return forum_tp_add_read_record($userid, $post->id); } else {