From fca220684957ca045e66983aa6f9415ba6fd7527 Mon Sep 17 00:00:00 2001 From: george-andreipascale Date: Tue, 7 Dec 2021 02:19:06 +0200 Subject: [PATCH] Fixed get_courses_with_today_sessions method when there are attendance instances in different days --- classes/attendance_webservices_handler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/attendance_webservices_handler.php b/classes/attendance_webservices_handler.php index d0c0d7a..6867659 100644 --- a/classes/attendance_webservices_handler.php +++ b/classes/attendance_webservices_handler.php @@ -65,11 +65,12 @@ class attendance_handler { $cm->id = $attendance->coursemodule; $att = new mod_attendance_structure($att, $cm, $course, $context); - $course->attendance_instance[$att->id] = array(); - $course->attendance_instance[$att->id]['name'] = $att->name; + $todaysessions = $att->get_today_sessions(); if (!empty($todaysessions)) { + $course->attendance_instance[$att->id] = array(); + $course->attendance_instance[$att->id]['name'] = $att->name; $course->attendance_instance[$att->id]['today_sessions'] = $todaysessions; $coursessessions[$course->id] = $course; }