From b606320a375e1595bd8b4611c0ffc68350a58a84 Mon Sep 17 00:00:00 2001 From: TamaroWalter Date: Wed, 24 Jan 2024 11:19:26 +0100 Subject: [PATCH] extra check in enrolled check --- classes/task/send_daily_mail.php | 2 +- locallib.php | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/classes/task/send_daily_mail.php b/classes/task/send_daily_mail.php index 67e6c2eee1..7dfbe02c98 100644 --- a/classes/task/send_daily_mail.php +++ b/classes/task/send_daily_mail.php @@ -58,7 +58,7 @@ public function execute() { foreach ($userdata as $row) { $currentcourse = $DB->get_record('course', array('id' => $row->courseid), 'fullname, id'); // Check if the user is enrolled in the course, if not, go to the next row. - if (!is_enrolled(\context_course::instance($row->courseid), $user->userid, '')) { + if (!is_enrolled(\context_course::instance($row->courseid), $user->userid, '', true)) { continue; } diff --git a/locallib.php b/locallib.php index 30e751657d..1141753535 100644 --- a/locallib.php +++ b/locallib.php @@ -928,12 +928,7 @@ function moodleoverflow_print_discussion($course, $cm, $moodleoverflow, $discuss // Retrieve all posts of the discussion. $posts = moodleoverflow_get_all_discussion_posts($discussion->id, $istracked, $modulecontext); - /*$newpost = []; - foreach($posts as $posti) { - $newpost[] = $posti->message; - } - var_dump($newpost); - */$usermapping = anonymous::get_userid_mapping($moodleoverflow, $discussion->id); + $usermapping = anonymous::get_userid_mapping($moodleoverflow, $discussion->id); // Start with the parent post. $post = $posts[$post->id];