MDL-87396 mod_assign: Add availability check to notifications
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user