From 5309fd39f83b86b5616d17f1ec613efc2cea9632 Mon Sep 17 00:00:00 2001 From: sam_marshall Date: Mon, 14 Jul 2008 15:39:55 +0000 Subject: [PATCH] MDL-15648: Used existing functionality to ensure that forum 'mark read' only marks posts read if they are within the right group. --- mod/forum/markposts.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mod/forum/markposts.php b/mod/forum/markposts.php index 1a41af940f..721f7dc760 100644 --- a/mod/forum/markposts.php +++ b/mod/forum/markposts.php @@ -60,7 +60,14 @@ add_to_log($course->id, "discussion", "mark read", "view.php?f=$forum->id", $d, $cm->id); } } else { - if (forum_tp_mark_forum_read($user, $forum->id)) { + // Mark all messages read in current group + $currentgroup = groups_get_activity_group($cm); + if(!$currentgroup) { + // mark_forum_read requires ===false, while get_activity_group + // may return 0 + $currentgroup=false; + } + if (forum_tp_mark_forum_read($user->id, $forum->id,$currentgroup)) { add_to_log($course->id, "forum", "mark read", "view.php?f=$forum->id", $forum->id, $cm->id); } } -- 2.39.5