Skip to content

Commit

Permalink
Merge branch 'MDL-75029-400' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_400_STABLE
  • Loading branch information
andrewnicols committed Aug 18, 2022
2 parents 76e2b6e + b9277ef commit dfb8817
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion blocks/news_items/block_news_items.php
Expand Up @@ -119,10 +119,19 @@ function get_content() {
if (!empty($CFG->forum_enabletimedposts) && ($discussion->timestart > $posttime)) {
$posttime = $discussion->timestart;
}

// If the user who created the discussion post has been deleted, indicate so.
if ($discussion->userdeleted) {
$userfullname = get_string('deleteduser', 'mod_forum');
} else {
$userfullname = fullname($discussion, has_capability('moodle/site:viewfullnames', $context));
}

$text .= '<li class="post">'.
'<div class="head clearfix">'.
'<div class="date">'.userdate($posttime, $strftimerecent).'</div>'.
'<div class="name">'.fullname($discussion).'</div></div>'.
'<div class="name">'.$userfullname.'</div>'.
'</div>'.
'<div class="info"><a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$discussion->discussion.'">'.$discussion->subject.'</a></div>'.
"</li>\n";
}
Expand Down
2 changes: 1 addition & 1 deletion mod/forum/lib.php
Expand Up @@ -1725,7 +1725,7 @@ function forum_get_discussions($cm, $forumsort="", $fullpost=true, $unused=-1, $

$allnames = $userfieldsapi->get_sql('u', false, '', '', false)->selects;
$sql = "SELECT $postdata, $discussionfields,
$allnames, u.email, u.picture, u.imagealt $umfields
$allnames, u.email, u.picture, u.imagealt, u.deleted AS userdeleted $umfields
FROM {forum_discussions} d
JOIN {forum_posts} p ON p.discussion = d.id
JOIN {user} u ON p.userid = u.id
Expand Down

0 comments on commit dfb8817

Please sign in to comment.