/posted filter does not include imported topics?

When my users visit the “/posted” page (ex. https://meta.discourse.org/posted ), it doesn’t include topics where posts have been imported from a previous site. This is despite their posts showing up on the “/u/xxx/activity/topics” page.

For my own account though, the “/posted” appears to be working fine with imported content. However, I did merge my imported account with the primary account the discourse instance was created with, so maybe this is the reason?

Is this a bug? If someone can help me understand or at least point me to the backend code on the discourse repo for the /posted filter, I can attempt to figure out the problem myself. As someone relatively new to Ruby and Rails, the file structure of the discourse github is still beyond my full comprehension. I appreciate it!

That’s my guess. If the posts were created by a user other than the one logged in, this is the expected behavior, right?

If the imported accounts are not the same as the accounts people are using, you’ll need to fix that.

1 Like

Perhaps I should clarify

On my account, I merged my initial discourse admin account with my imported account from the older forum. All the topics I have ever posted in correctly show up on /posted

For everyone else, the account they are using was only imported from the old site. For them, only topics they have posted in after the import show up in /posted. I have confirmed this using a test alt account I have

I assume that imported posts should still matter when it comes to what shows up on /posted, so the behavior is correct for my account but not for all the other users. I’m assuming the merge step is what did it because that assigns all my old posts to a new account AFTER they have been imported

What I would do next is to confirm that that posts not showing up in /posted do, in fact, belong to the user that is looking for them. Something like

 u = User.find_by_username('whateverUser')
 posts = Post.where(user_id: u.id)

And see if those posts include the ones you think should show up or not.

Conversely, you could

 p = Post.find(post_id_you_want)

and see what user owns that post.

1 Like

Imported topics appear on the /my/activity/topics page and not on the /posted page for users other than myself.

Imported posts also appear under /my/activity/replies but corresponding topics do not appear on the /posted page for users other than myself.

I have also confirmed through an example topic. The user_id on /t/xxx.json matches the user id on /u/yyy.json but topic xxx does not appear on /posted for user yyy

I can also try running the code you provided but there doesn’t seem to be a reason to think this is an ownership problem as far as I can tell.

FWIW There was a similar issue with changing post ownership some time back. I wonder if that could provide some additional clues for your situation?

1 Like

it seems like a similar issue as you say (not quite the same though), maybe I can dig into the code that was updated on that commit

1 Like