XF 2.2 Need the sql used to view a thread

pattycake2

Active member
I have a few threads from a VB import that give the "Ooops" message. Does anyone know what the sql that XF uses to display a thread. If I have the sql statement, I might be able to find the issue in phpadmin
 
The 'sql' isn't really going to help.

What is the exact error message?

What does the thread record in the DB look like?
It's in xf_thread and the ID is in the URL.

1672533766109.webp
 
The 'sql' isn't really going to help.

What is the exact error message?

What does the thread record in the DB look like?
It's in xf_thread and the ID is in the URL.

View attachment 279245
Error msg is the standard "oops"
Oops! We ran into some problems.
Something went wrong. Please try again or contact the administrator.

Thread record in db looks clean... I suspect it's a post in the thread that is bad, missing, corrupted or ?

did this SELECT * FROM xf_post WHERE thread_id = 315569
- it returned 278 records from phpmyadmin

Thats why I think if I used the exact sql query that XF uses, I'll see and error or exception in phpmyadmin
 
Last edited:
Forum: In Memorium - KTMTalk members that have died

Link to forum

thread: 2nd page
4th from the bottom
title=Justin Macko aka KTMTALK MEMBER macko00xj (Killed while serving in Iraq)

Link to that page: https://ktmtalk.com/forums/in-memoriam-ktmtalk-members.105/page-2

actual link to thread : https://ktmtalk.com/threads/justin-...acko00xj-killed-while-serving-in-iraq.315569/

actually having the same problem with lots of threads on that page

These are very old threads from vb where in stupidity allowed html

could very well be ugly html code in one of the threads??
 
It's happening on several threads in that forum.

Also, the threads that do load don't appear to be formatted correctly, i.e. there's HTML displaying as text along with the post content; is that intentional?
 
I just noticed... if I put the mouse on the thread title, if it shows part of the first post in the popup, it's viewable. If it doesn't show anything, it's "ooops"

So, I wonder what the sql that pops up the first post contents when a mouse hovers over the thread?
I think I'll phpmyadmin on a bad one and look at the first post to see if it has issues
 
Bingo.... thats' how to fix.
Use phpmyadmin to find 1st post_id of the thread
Then phpmyadmin to view/edit that post
Edit the actual post and bingo, it's no longer "oops"

Still wish I knew what the sql for the mouse-over popup or, the sql to view posts in a thread...
 
I have a few threads from a VB import that give the "Ooops" message. Does anyone know what the sql that XF uses to display a thread. If I have the sql statement, I might be able to find the issue in phpadmin


Check src/XF/Pub/Controller/Thread.php

At line 45 you'll see an "oops" error call. This may be the one that was being triggered in your case.
 
Thank you for pointing me in the right direction.... now I gotta find that function findPostsForThreadView and I'll be on my way to finding the exact sql statement. Would have been nice for a developer to give me the exat sql but your help will do the trick... just takes longer and I was being lazy.

btw: the cause of the oooops, was that the first post_id in the XF_Thfeads table was missing. A quick edit of the thread (after finding "another" first post_id, and bingo, the view now works. Took a bit of work to set last post, first post, date, in xf_threads etc but with 250+ posts in that thread, it was worth the effort.
 
Top Bottom