The issue involves a bug where, after splitting a topic, a quoted post in the new topic incorrectly references a deleted post from the original topic, displaying a trash can icon. MarcP describes the scenario where Post 7 in Topic A quotes Post 6, and after splitting from Post 3, Post 4 in the new topic (formerly Post 7) shows a broken quote referencing the deleted Post 6. Simon confirms the bug, noting a 404 error when expanding the quote, and provides a test case. MarcP observes the trash can icon and notes the URL links to a moved message. Dan proposes a fix to handle quote references by replacing old post IDs with current ones from quoted_posts and moved_posts, though the solution is noted as a best-effort approach.
Topic A has 7 posts. Post 7 quotes a part of the text from Post 6.
We split to new topic (B) from Post 3 and below, because this part is off-topic.
In the new topic (B), Post 4 (Post 7 from topic A) shows the quote to a deleted Post 6 from topic A showing a trash can icon within the quote block, while I think it should show the quote of post 3 (post 6 in topic A) in the new topic.
Yes, I can reproduce that here: https://try.discourse.org/t/topic-splitting-test-part-two/1388. When I try to expand quote in the last post in the split topic, a request is made to the topic the posts were split from. This returns a 404 response and causes the trash can icon to be displayed.
This is a best-effort fix which tries to replace constructs such as post:{old post number}, topic:{old topic ID} using data from quoted_posts and moved_posts, without knowing if it is indeed a part of the [quote] tag.