Sort order affecting number of threads displayed. HELP!


Well-known member
I've had a nagging and ongoing issue for some weeks now, and after much diagnosis and testing I just cannot resolve it. (n) Please help! :)

Issue: When displaying the thread list for a forum, the sort order is affecting the quantity of threads displayed on the page. Examples ...

LastMessage.png StartDate.png

You can see when the display is sorted by Last Message it only shows 2 threads, but when sorted by Start Date it correctly shows 30 threads. Interestingly, if I change the sort order to Last Message Ascending then it correctly shows 30 threads, change it back to Last Message Descending and it shows only 2 threads.

I have turned all Add-Ons off (via "$config['enableListeners'] = 0;" in config.php) with no resolution. I have rebuild both Forum cache and Thread cache (including tick on for 'Rebuild position and post counters') with no resolution. I am using the Default Style (as per attached screenshots) to ensure it's no something introduced by my normal style (which has the same issue too).

Any resolution or tips/ideas would be much appreciated.
I have never seen this before, and I have no idea what could be causing it considering you already disabled addons and rebuilt the caches.

I can take a look if you give me admin and FTP access.
There was a problem with the indexes on xf_thread_read. I was able to fix it on my server (using your data) by running these queries:

ALTER TABLE xf_thread_read
DROP INDEX user_id_thread_id;

ALTER IGNORE TABLE xf_thread_read
ADD UNIQUE KEY user_id_thread_id (user_id, thread_id);

But the second query returned an error when I ran it on your server. The IGNORE part didn't work which resulted in duplicate key errors when recreating the index. I had to drop the table and recreate it on your forum. This has fixed the problem, but existing read markers will be reset now.
Very much appreciate your assistance on this unusual issue Jake, and sticking with me to resolution.
I hope the PayPal donation is enough to give you (and your spouse or loved ones) a reasonable dinner or overnight stay somewhere nice, or a round of brewski's for you and some mates ... whomever your attention could have otherwise been given instead of working through this issue :)
Top Bottom