Post created by null user and flagged as deleted


(Jeff Vienneau) #1

I noticed that a post on a topic was deleted so I investigated and found it had a null for user but was obviously valid content from a legitimate user.

I then marked the post as undeleted but since I had no way of assigning it to a user, it kept the null user field. This was a bad idea, since now the topic is unreadable.

How did the post get a null for user?
How to fix so users can see the other posts in the topic?


(Jeff Vienneau) #2

Ok, so I fixed the post with null user by assigning it to a valid user using rails console.

Note the user that I believe made the post was “bent6543” and still exists. However, there is a system log where a user named “bent65432” is deleted:

Perhaps, something went wrong while user was configuring his preferences?


(Jeff Atwood) #3

Users can self delete if they have 1 post or less. This user self deleted via their preferences page.

Try it yourself as a new user.


(Jeff Vienneau) #4

Good to know, thanks.

so if there was one post, its user_id gets set to nil and the post deleted? I guess my mistake was to un-delete the dangling post.

Maybe posts with nil for a user_id not should be un-deletable.


(cpradio) #5

Why? Personally I think you should be able to change the owner on a nil user, so that would be the change I’d see being made (without involving the Ruby Console). :smile:


(Jeff Vienneau) #6

I just noticed that if you are an admin you can “select posts” from wrench menu and then select the post and then an option to change owner appears.