mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-39947 mod_forum: Add safety check to variable assignment when counting unread posts
This commit is contained in:
parent
b6f8a93642
commit
f985bc4e65
@ -6760,7 +6760,11 @@ function forum_tp_count_forum_unread_posts($cm, $course) {
|
||||
$modinfo->groups = groups_get_user_groups($course->id, $USER->id);
|
||||
}
|
||||
|
||||
if (array_key_exists($cm->groupingid, $modinfo->groups)) {
|
||||
$mygroups = $modinfo->groups[$cm->groupingid];
|
||||
} else {
|
||||
$mygroups = false; // Will be set below
|
||||
}
|
||||
|
||||
// add all groups posts
|
||||
if (empty($mygroups)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user