Skip to content

A platform for community discussion. Free, open, simple.

FIX: error when opening a previously deleted post (#19346)

Andrei Prigorshnev26a45e816623
diff --git a/app/assets/javascripts/discourse/app/models/post-stream.js b/app/assets/javascripts/discourse/app/models/post-stream.js
index 295061e3e01..58df4e99db6 100644
--- a/app/assets/javascripts/discourse/app/models/post-stream.js
+++ b/app/assets/javascripts/discourse/app/models/post-stream.js
@@ -396,6 +396,7 @@ export default RestModel.extend({
if (postIdx !== -1) {
return this.findPostsByIds(headGap).then((posts) => {
posts.forEach((p) => {
+ this._initUserModels(p);
const stored = this.storePost(p);
if (!currentPosts.includes(stored)) {
currentPosts.insertAt(postIdx++, stored);
diff --git a/app/assets/javascripts/discourse/app/widgets/post-cooked.js b/app/assets/javascripts/discourse/app/widgets/post-cooked.js
index ae19ed8756e..2fd95732d95 100644
--- a/app/assets/javascripts/discourse/app/widgets/post-cooked.js
+++ b/app/assets/javascripts/discourse/app/widgets/post-cooked.js
@@ -69,7 +69,7 @@ export default class PostCooked {
this._insertQuoteControls(cookedDiv);
this._showLinkCounts(cookedDiv);
this._applySearchHighlight(cookedDiv);
- this._initUserStatusToMentions();
+ this._initUserStatusOnMentions();
this._decorateAndAdopt(cookedDiv);
return cookedDiv;
@@ -374,7 +374,7 @@ export default class PostCooked {
return cookedDiv;
}
- _initUserStatusToMentions() {
+ _initUserStatusOnMentions() {
if (!this._isInComposerPreview) {
this._trackMentionedUsersStatus();
this._rerenderUserStatusOnMentions();