Browse Source

Improve error checking when a status item was deleted.

MOODLE_38_STABLE
Dan Marsden 4 years ago
parent
commit
9d0537aa0f
  1. 1
      lang/en/attendance.php
  2. 7
      renderhelpers.php

1
lang/en/attendance.php

@ -599,6 +599,7 @@ $string['tuseremail'] = 'Email';
$string['tusername'] = 'Full name'; $string['tusername'] = 'Full name';
$string['ungraded'] = 'Ungraded sessions'; $string['ungraded'] = 'Ungraded sessions';
$string['unknowngroup'] = 'Unknown group'; $string['unknowngroup'] = 'Unknown group';
$string['unknownstatus'] = 'Unknown status id: {$a}';
$string['update'] = 'Update'; $string['update'] = 'Update';
$string['uploadattendance'] = 'Upload attendance by CSV'; $string['uploadattendance'] = 'Upload attendance by CSV';
$string['usedefaultsubnet'] = 'Use default'; $string['usedefaultsubnet'] = 'Use default';

7
renderhelpers.php

@ -68,7 +68,12 @@ class user_sessions_cells_generator {
$this->construct_existing_status_cell($this->reportdata->statuses[$statusid]->acronym . $this->construct_existing_status_cell($this->reportdata->statuses[$statusid]->acronym .
" ({$points}/{$maxpoints})"); " ({$points}/{$maxpoints})");
} else { } else {
$this->construct_hidden_status_cell($this->reportdata->allstatuses[$statusid]->acronym); if (!empty($this->reportdata->allstatuses[$statusid] && isset($this->reportdata->allstatuses[$statusid]->acronym))) {
$statusac = $this->reportdata->allstatuses[$statusid]->acronym;
} else {
$statusac = get_string('unknownstatus', 'mod_attendance', $statusid);
}
$this->construct_hidden_status_cell($statusac);
} }
if ($remarks) { if ($remarks) {
$this->construct_remarks_cell($this->reportdata->sessionslog[$this->user->id][$sess->id]->remarks); $this->construct_remarks_cell($this->reportdata->sessionslog[$this->user->id][$sess->id]->remarks);

Loading…
Cancel
Save