Index: mod/forum/lib.php =================================================================== --- mod/forum/lib.php (revision 16030) +++ mod/forum/lib.php (revision ) @@ -4176,7 +4176,8 @@ $sql = "SELECT f.id FROM {$CFG->prefix}forum f LEFT JOIN {$CFG->prefix}forum_subscriptions fs ON (fs.forum = f.id AND fs.userid = $USER->id) - WHERE f.forcesubscribe <> ".FORUM_DISALLOWSUBSCRIBE." + WHERE f.course = $course->id + AND f.forcesubscribe <> ".FORUM_DISALLOWSUBSCRIBE." AND (f.forcesubscribe = ".FORUM_FORCESUBSCRIBE." OR fs.id IS NOT NULL)"; if ($subscribed = get_records_sql($sql)) { foreach ($subscribed as $s) {