Skip to content

Commit

Permalink
fix: post mentions with deleted author not rendering (#3432)
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 authored Jun 2, 2022
1 parent df1bdd2 commit 0a3f449
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extensions/mentions/src/ConfigureMentions.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,13 @@ public static function addPostId($tag)
{
$post = CommentPost::find($tag->getAttribute('id'));

if ($post && $post->user) {
if ($post) {
$tag->setAttribute('discussionid', (int) $post->discussion_id);
$tag->setAttribute('number', (int) $post->number);
$tag->setAttribute('displayname', $post->user->display_name);

if ($post->user) {
$tag->setAttribute('displayname', $post->user->display_name);
}

return true;
}
Expand Down

0 comments on commit 0a3f449

Please sign in to comment.