Browse Source

Improve error checking when a status item was deleted.

40-behatfixes
Dan Marsden 4 years ago
parent
commit
4e147131c7
  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['ungraded'] = 'Ungraded sessions';
$string['unknowngroup'] = 'Unknown group';
$string['unknownstatus'] = 'Unknown status id: {$a}';
$string['update'] = 'Update';
$string['uploadattendance'] = 'Upload attendance by CSV';
$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 .
" ({$points}/{$maxpoints})");
} 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) {
$this->construct_remarks_cell($this->reportdata->sessionslog[$this->user->id][$sess->id]->remarks);

Loading…
Cancel
Save