From 0b3d6bb3d263cab3d8dae5f4dcb7abbfb6be55f4 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Mon, 22 Jan 2018 10:53:40 +1300 Subject: [PATCH] Prevent sessions from being added to attendance activites in recycle bin. --- classes/import/sessions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/import/sessions.php b/classes/import/sessions.php index 3ea6eaf..69b907a 100644 --- a/classes/import/sessions.php +++ b/classes/import/sessions.php @@ -389,6 +389,10 @@ class sessions { foreach ($activities as $activity) { // Build the session data. $cm = get_coursemodule_from_instance('attendance', $activity->id, $course->id); + if (!empty($cm->deletioninprogress)) { + // Don't do anything if this attendance is in recycle bin. + continue; + } $att = new mod_attendance_structure($activity, $cm, $course); $sessions = attendance_construct_sessions_data_for_add($session, $att);