Admins can see a list of deleted user posts at /u/username/deleted-posts
. The expectation is that a listed post will include the title of the topic it belongs to (linking to the relevant post), as well as a link to the category that holds the topic. I’m finding that if the topic post (OP) of the associated topic is deleted, that deleted post and any deleted replies will be listed without including a title and category link. The code suggests that the title and category would be shown in all cases.
An example shows how the topic titles are displayed when the OP has been deleted, and when the OP still exists:
The code for the page comes from:
And the evaluation of postUrl
seems to come from here, line 106:
import getURL, { getURLWithCDN } from "discourse-common/lib/get-url";
import Handlebars from "handlebars";
import I18n from "I18n";
import { deepMerge } from "discourse-common/lib/object";
import { escape } from "pretty-text/sanitizer";
import { helperContext } from "discourse-common/lib/helpers";
import toMarkdown from "discourse/lib/to-markdown";
import deprecated from "discourse-common/lib/deprecated";
let _defaultHomepage;
export function splitString(str, separator = ",") {
if (typeof str === "string") {
return str.split(separator).filter(Boolean);
} else {
return [];
}
}
export function translateSize(size) {
This file has been truncated. show original
It’s still possible to reach the content of the deleted posts through the logs, if necessary:
3 Likes
Just to note that this has cropped up in another topic recently too -
2 Likes
nat
(Natalie T)
December 28, 2022, 4:24pm
7
Merged the fix. Thanks for the report
discourse:main
← discourse:show-title-in-deleted
opened 03:01PM - 23 Dec 22 UTC
https://meta.discourse.org/t/topic-titles-missing-from-deleted-posts-page-when-o… p-is-deleted/233350
`/u/\<username>/deleted-posts` weren't showing topic titles because sadly `Topic.unscoped` still didn't allow posts with deleted topics to associate properly. Undoing https://github.com/discourse/discourse/pull/17329 to allow it.
Before
<img width="459" alt="Screenshot 2022-12-23 at 11 00 00 PM" src="https://user-images.githubusercontent.com/1555215/209356395-57c62b7b-d6c3-4f81-82c2-f99706bae90c.png">
After
<img width="459" alt="Screenshot 2022-12-23 at 11 00 27 PM" src="https://user-images.githubusercontent.com/1555215/209356410-74683f02-1e47-44ea-8486-00e922f5c4ff.png">
5 Likes
nat
(Natalie T)
Closed
December 31, 2022, 12:00am
8
This topic was automatically closed after 2 days. New replies are no longer allowed.