Browse Source

Fix issue that occurs when updating an individual warning.

MOODLE_34_STABLE
Dan Marsden 7 years ago
parent
commit
f7f4ee7e52
  1. 2
      warnings.php

2
warnings.php

@ -124,7 +124,7 @@ if ($data = $mform->get_data()) {
$notify->thirdpartyemails = implode(',', $data->thirdpartyemails); $notify->thirdpartyemails = implode(',', $data->thirdpartyemails);
} }
$existingrecord = $DB->get_record('attendance_warning', array('idnumber' => $notify->idnumber, $existingrecord = $DB->get_record('attendance_warning', array('idnumber' => $notify->idnumber,
'warningpercent' => $notify->warningpercent)); 'warningpercent' => $notify->warningpercent, 'warnafter' => $notify->warnafter));
if (empty($existingrecord) || $existingrecord->id == $notify->id) { if (empty($existingrecord) || $existingrecord->id == $notify->id) {
$DB->update_record('attendance_warning', $notify); $DB->update_record('attendance_warning', $notify);
echo $OUTPUT->notification(get_string('warningupdated', 'mod_attendance'), 'success'); echo $OUTPUT->notification(get_string('warningupdated', 'mod_attendance'), 'success');

Loading…
Cancel
Save