Skip to content

Commit

Permalink
Fix #776
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Nov 19, 2024
1 parent cecfc26 commit 1249aa1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions classes/form/updatesession.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ public function definition() {
$modcontext = $this->_customdata['modcontext'];
$sessionid = $this->_customdata['sessionid'];

if (!$sess = $DB->get_record('attendance_sessions', ['id' => $sessionid] )) {
error('No such session in this course');
}
$sess = $DB->get_record('attendance_sessions', ['id' => $sessionid], '*', MUST_EXIST);

$attendancesubnet = $DB->get_field('attendance', 'subnet', ['id' => $sess->attendanceid]);
$defopts = ['maxfiles' => EDITOR_UNLIMITED_FILES, 'noclean' => true, 'context' => $modcontext];
$sess = file_prepare_standard_editor($sess, 'description', $defopts, $modcontext, 'mod_attendance', 'session', $sess->id);
Expand Down
3 changes: 0 additions & 3 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,6 @@ function attendance_grade_item_update($attendance, $grades=null) {
if (!isset($attendance->courseid)) {
$attendance->courseid = $attendance->course;
}
if (!$DB->get_record('course', ['id' => $attendance->course])) {
error("Course is misconfigured");
}

if (!empty($attendance->cmidnumber)) {
$params = ['itemname' => $attendance->name, 'idnumber' => $attendance->cmidnumber];
Expand Down

0 comments on commit 1249aa1

Please sign in to comment.