-
Bug
-
Resolution: Fixed
-
Minor
-
2.3.7, 2.4.4, 2.5
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
-
Due to a bug in the forum_tp_count_forum_unread_posts() function, for some users in some forum discussions, it's possible for the function to trigger a large amount of php notices.
This is due to the following line assuming an array element exists:
$mygroups = $modinfo->groups[$cm->groupingid];
|
This same assignment occurs earlier in the forum/lib.php file, but has protection like so:
if (array_key_exists($cm->groupingid, $modinfo->groups)) {
|
$mygroups = $modinfo->groups[$cm->groupingid];
|
} else {
|
$mygroups = false; // Will be set below
|
}
|
My proposed solution is to use this same checking & assignment as it achieves the same result and fixes the bug.
- Discovered while testing
-
MDL-40145 Notices are generated on course page after deleting a grouping
- Closed