-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix: Determine if a post has a user before setting mention details #41
fix: Determine if a post has a user before setting mention details #41
Conversation
Fixes #1956 - ErrorException: Trying to get property 'display_name' of non-object. ConfigureMentions::addPostId method set mention details based on if there was an existing post. This caused an error if there was an existing post, but the user who posted had been deleted. The mention details are now only set if there is a user associated with the post being mentioned.
When mentioning a post written by a deleted user, the post->user property was null. This prompted an error when it attempted to set the displayname attribute to the post->user->displayname property. |
@oddjob79 Did you close this on purpose? 🤔 |
@franzliedke No, sorry about that. I thought it didn't go quite right. |
Co-Authored-By: Franz Liedke <[email protected]>
FYI - log showing error mentioned in the change log When changing the display_name attribute, there was an error produced when attempting to restore a deleted post which mentioned a deleted user. |
@oddjob79 Congrats on getting your first PR merged, thanks for sending it in the first place and sorry for taking so long! 😍 |
P.S.: Feel free to submit an issue about that other problem you encountered. |
Fixes #1956 - ErrorException: Trying to get property 'display_name' of non-object. ConfigureMentions::addPostId method set mention details based on if there was an existing post. This caused an error if there was an existing post, but the user who posted had been deleted. The mention details are now only set if there is a user associated with the post being mentioned.
Fixes #1956 - ErrorException: Trying to get property 'display_name' of non-object. ConfigureMentions::addPostId method set mention details based on if there was an existing post. This caused an error if there was an existing post, but the user who posted had been deleted. The mention details are now only set if there is a user associated with the post being mentioned.
Fixes flarum/framework#1956 - ErrorException: Trying to get property 'display_name' of
non-object. ConfigureMentions::addPostId method set mention details
based on if there was an existing post. This caused an error if there
was an existing post, but the user who posted had been deleted. The
mention details are now only set if there is a user associated with the
post being mentioned.