# Topic splitting made a quote show as deleted message in new topic

**URL:** https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868
**Category:** Bug
**Created:** [7 בנובמבר,‏ 2019,‏ 7:41pm UTC](https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868 "2019-11-07T19:41:24Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [7 בנובמבר,‏ 2019,‏ 7:41pm UTC](https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868/1 "2019-11-07T19:41:24Z")

</div>

I try to clearly describe the bug:

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.

Can someone reproduce? I’m on ([60a235d128](https://github.com/discourse/discourse/commits/60a235d128e78b43e33a859b2c9534d0d96ebce3))

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [7 בנובמבר,‏ 2019,‏ 10:08pm UTC](https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868/2 "2019-11-07T22:08:43Z")

</div>

> [@MarcP](#):
>
> Can someone reproduce?

Yes, I can reproduce that here: [https://try.discourse.org/t/topic-splitting-test-part-two/1388](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.

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [7 בנובמבר,‏ 2019,‏ 10:11pm UTC](https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868/3 "2019-11-07T22:11:55Z")

</div>

This is strange. As a guest, I am not seeing the trashcan icon, but the correct quote - with working URL.

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/d/5db01c286c6087df002fb6b336455b662d79ac92.png)

Edit: actually the URL is linking to the move message:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/d/bdab971bda8d65004b3b5ef2516f0264960fc584.png)

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [7 בנובמבר,‏ 2019,‏ 10:18pm UTC](https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868/4 "2019-11-07T22:18:09Z")

</div>

What happens when you click the caret icon to expand the post?

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/2/f22f85665a46fd93f6436eeac82d94e70a9251eb.png)

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [7 בנובמבר,‏ 2019,‏ 10:21pm UTC](https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868/5 "2019-11-07T22:21:40Z")

</div>

Ah, the trashcan. I actually don’t remember if I did see the original quoted text at any moment on my production side.

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/b/3b06587628ab741ba70ee3bcb43fde9896e9a904.png)

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [8 בנובמבר,‏ 2019,‏ 6:02pm UTC](https://meta.discourse.org/t/topic-splitting-made-a-quote-show-as-deleted-message-in-new-topic/132868/8 "2019-11-08T18:02:31Z")

</div>

I had a try at fixing this issue here:

[https://github.com/discourse/discourse/pull/8326](https://github.com/discourse/discourse/pull/8326)

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.
