Browse Source

Check if userto is empty (extra comma in thirdpartyusers field)

MOODLE_32_STABLE
Dan Marsden 7 years ago
parent
commit
297edb8d8c
  1. 4
      classes/task/notify.php

4
classes/task/notify.php

@ -106,6 +106,10 @@ class notify extends \core\task\scheduled_task {
$record->percent = round($record->percent * 100)."%"; $record->percent = round($record->percent * 100)."%";
$context = \context_module::instance($record->cmid); $context = \context_module::instance($record->cmid);
foreach ($sendto as $senduser) { foreach ($sendto as $senduser) {
if (empty($senduser)) {
// Probably an extra comma in the thirdpartyusers field.
continue;
}
// Check user is allowed to receive warningemails. // Check user is allowed to receive warningemails.
if (has_capability('mod/attendance:warningemails', $context, $senduser)) { if (has_capability('mod/attendance:warningemails', $context, $senduser)) {
if (empty($thirdpartynotifications[$senduser])) { if (empty($thirdpartynotifications[$senduser])) {

Loading…
Cancel
Save