flarum / framework

Simple forum software for building great communities.
http://flarum.org/
6.27k stars 826 forks source link

`DiscussionTaggedPost` might show "deleted" when tag is secondary #3863

Closed iPurpl3x closed 10 months ago

iPurpl3x commented 1 year ago

Current Behavior

When a discussion has a DiscussionTaggedPost event post, and this is a tag that has been deleted from the discussion, and this tag is secondary and thus not serialized in the ForumSerializer, the UI shows "deleted", as the tag is nowhere to be found in the frontend.

Steps to Reproduce

  1. As admin, create at least 5 secondary tags
  2. Use the last tag (the one with the highest id) in a discussion (let's say we take tag5)
  3. Lock the discussion or add a reply (we just want a new post in the stream)
  4. Remove the tag that had been added (tag5)
  5. See the event post appear in the UI
  6. Reload the page
  7. See that the event post shows "deleted" instead of "tag5".

Expected Behavior

The UI should show the correct tag label and not deleted.

Screenshots

Before reload: Click to expand Screenshot 2023-08-10 at 10 28 12

After reload:

After reload: Click to expand Screenshot 2023-08-10 at 10 28 20

Environment

Possible Solution

Add a relationship to the DiscussionTaggedPost ?... Somehow the tag needs to be explicitly loaded by the API when showing the discussion or post

Additional Context

No response