Skip to content

Commit

Permalink
extra check in enrolled check
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaroWalter committed Jan 24, 2024
1 parent 2eeb0f7 commit b606320
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion classes/task/send_daily_mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 1 addition & 6 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit b606320

Please sign in to comment.