Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextFormatter is unable to render Mentions #3

Closed
the-turk opened this issue May 31, 2020 · 3 comments
Closed

TextFormatter is unable to render Mentions #3

the-turk opened this issue May 31, 2020 · 3 comments

Comments

@the-turk
Copy link

the-turk commented May 31, 2020

Hey @askvortsov1,

I see you added the TextFormatter support with 0.1.9 but it won't work with the Mentions extension. When you add a new warning with some mentions in it, you'll end up with a notice as a result of GET request:

Notice: Trying to get property 'mentionsUsers' of non-object in ...\flarum\mentions\src\Listener\FormatUserMentions.php on line 22

Steps to reproduce:

  1. Click "New Warning" button.
  2. Mention someone using @whoever in the comment section.
  3. Refresh the page.
  4. See the notice.

This was the exact reason why I did this trick here in the Diff extension:

https://github.com/the-turk/flarum-diff/blob/8b660cf2e51e19a940fa6cdf33136770b38aa723/src/Listeners/AddDiffRelationship.php#L305-L327

It fixes the issue but I'm not happy with it so I'll be glad if you can find a more clean solution for this.

@askvortsov1
Copy link
Owner

Hmm this is something I hadn't considered, thanks for bringing it up! Tbh, I'm not sure that mentions are needed in text formatter? I'll see if it can't be tweaked so that mentions don't evaluate.

@the-turk
Copy link
Author

the-turk commented May 31, 2020

FriendsOfFlarum/moderator-notes#9

FriendsOfFlarum/moderator-notes@27afa0c

it's indeed more clear than mine 😄

@askvortsov1
Copy link
Owner

askvortsov1 commented May 31, 2020

Thanks for finding this! I'll definitely steal Ian's fix fix this bug shortly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants