diff --git a/export.php b/export.php index de8443b..e270487 100644 --- a/export.php +++ b/export.php @@ -110,7 +110,11 @@ if ($formdata = $mform->get_data()) { foreach ($reportdata->sessions as $sess) { $text = userdate($sess->sessdate, get_string('strftimedmyhm', 'attendance')); $text .= ' '; - $text .= $sess->groupid ? $reportdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance'); + if (!empty($sess->groupid) && empty($reportdata->groups[$sess->groupid])) { + $text .= get_string('deletedgroup', 'attendance'); + } else { + $text .= $sess->groupid ? $reportdata->groups[$sess->groupid]->name : get_string('commonsession', 'attendance'); + } $data->tabhead[] = $text; if (isset($formdata->includeremarks)) { $data->tabhead[] = ''; // Space for the remarks. diff --git a/renderer.php b/renderer.php index 38f9143..fe86450 100644 --- a/renderer.php +++ b/renderer.php @@ -867,7 +867,12 @@ class mod_attendance_renderer extends plugin_renderer_base { } $sesstext .= html_writer::empty_tag('br'); if ($sess->groupid) { - $sesstext .= get_string('group') . ': ' . $reportdata->groups[$sess->groupid]->name; + if (empty($reportdata->groups[$sess->groupid])) { + $sesstext .= get_string('deletedgroup', 'attendance'); + } else { + $sesstext .= get_string('group') . ': ' . $reportdata->groups[$sess->groupid]->name; + } + } else { $sesstext .= get_string('commonsession', 'attendance'); }