From: sam_marshall Date: Mon, 14 Jul 2008 15:39:55 +0000 (+0000) Subject: MDL-15648: Used existing functionality to ensure that forum 'mark read' only marks... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5309fd39f83b86b5616d17f1ec613efc2cea9632;p=moodle.git MDL-15648: Used existing functionality to ensure that forum 'mark read' only marks posts read if they are within the right group. --- 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); } }