You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Behavior
If you try mentioning a post whose author is [deleted], the preview will render correctly, but after saving the mention will stay as plain text.
Steps to Reproduce
Create post and delete author, either by deleting the user or setting user_id null in the database
Use reply button or @ syntax to mention the post with deleted author
Preview shows mention as expected
Submit post
Final post doesn't contain mention
Expected Behavior
It should be possible to mention those posts. In fact it works fine if the author is deleted after the reply is created. But if the reply is created afterwards, it doesn't work.
Screenshots
Preview:
Submitted:
Environment
Flarum version: 1.2.1, likely still in 1.3.0 because the master code still contains the issue right now
which only saves a mention if both the post and author exist.
I think we should just move $tag->setAttribute('displayname', $post->user->display_name); to a separate if( $post->user). Not sure if we should put a different default value for displayname. Its value will already be set to [deleted] in Formatter/FormatPostMentions anyway.
The preview JavaScript code doesn't have that limitation
Bug Report
Current Behavior
If you try mentioning a post whose author is [deleted], the preview will render correctly, but after saving the mention will stay as plain text.
Steps to Reproduce
user_id
null in the database@
syntax to mention the post with deleted authorExpected Behavior
It should be possible to mention those posts. In fact it works fine if the author is deleted after the reply is created. But if the reply is created afterwards, it doesn't work.
Screenshots


Preview:
Submitted:
Environment
Possible Solution
The problem is in
framework/extensions/mentions/src/ConfigureMentions.php
Lines 124 to 135 in 471947d
I think we should just move
$tag->setAttribute('displayname', $post->user->display_name);
to a separateif( $post->user)
. Not sure if we should put a different default value fordisplayname
. Its value will already be set to[deleted]
inFormatter/FormatPostMentions
anyway.The preview JavaScript code doesn't have that limitation
framework/extensions/mentions/js/src/forum/utils/textFormatter.js
Lines 23 to 33 in 471947d
The text was updated successfully, but these errors were encountered: