XF 2.2 Threads without posts after import

smozgur

Active member
I found zero post thread records in the threads table coming from the old forum's database during the import. All of them have discussion_state is "visible", first_post_id is "0". Since there is no related post for these threads, and they are marked as "visible", all you get is 40x error with the following message:
Something went wrong. Please try again or contact the administrator.
It doesn't affect anything but the search engine reports them as errors since they are always included in the sitemap.xml.

What would be the correct approach to solving this issue?
  1. Deleting these records from the database manually (this one is my initial idea).
  2. Marking these thread records as "deleted" manually.
  3. Or is there something internal that will clear these posts in the admin panel? I wonder if the Rebuild Threads tool checks the post count and deletes the orphan (kind of) records already.
Thanks in advance for any help.
 

Kirby

Well-known member
Check if the threads also have had zero posts in the source darabase.
If they have had zero posts I'd hard delete them as they are just garbage.
 
Last edited:

smozgur

Active member
Thanks, @Kirby

Check if the threads also had zero posts in the source darabase.
Yes, I did. The import has been completed a while ago, but I didn't notice this before, only when I was trying to fix Search Console errors.

If they have had zero posts I'd hard delete them as they are just garbage.
I will watch this thread to see if the internal tool already takes care of this (actually I don't think so since I already run it after the initial import), but yes, this looks to be the way to go.

(Perhaps the sitemap creator should verify if the thread has any post before including the URL in the XML.)

Thanks again.
 
Top