MDL-87396 mod_assign: Add availability check to notifications

This commit is contained in:
Iñigo Zendegi
2026-01-30 11:41:12 +01:00
parent 50e44173c8
commit a73abacee5
@@ -352,6 +352,12 @@ class notification_helper {
return;
}
// Check if the module is visible to the user.
$cm = $assignmentobj->get_course_module();
if (!\core_availability\info_module::is_user_visible($cm, $userid)) {
return;
}
// Check if the due date still within range.
$assignmentobj->update_effective_access($userid);
$duedate = $assignmentobj->get_instance($userid)->duedate;
@@ -458,6 +464,12 @@ class notification_helper {
return;
}
// Check if the module is visible to the user.
$cm = $assignmentobj->get_course_module();
if (!\core_availability\info_module::is_user_visible($cm, $userid)) {
return;
}
// Check if the due date still considered overdue.
$assignmentobj->update_effective_access($userid);
$duedate = $assignmentobj->get_instance($userid)->duedate;