[Solved] Topic pages disappeared
Please navigate to Dashboard > Forums > Settings > Feature admin page, make sure the HTML Cache is disabled. Then navigate to Dashboard > Forums > Dashboard admin page, click on [Delete all caches] button. If you use some other cache plugins, delete those plugins caches as well and press CTRL+F5 (twice) on the current page.
I disabled and deleted all caches. I have updated the database. I don't use any custom template. Pressed Ctrl+F5 several times. Nothing changed 🙁
Specified topic has 55 answers, but I see only first 10. No topic navigation.
Could you please send admin login details to info[at]gvectors.com email address to allow us to check it.
I assume, that the problem related to new DB structure.
I examined SQL queries and found that for example this one:
WHERE `prefix_wpforo_posts`.`topicid` = 385
AND `prefix_wpforo_posts`.`parentid` = 0
returns 0. If I delete this argument
AND `prefix_wpforo_posts`.`parentid` = 0
the query returns 56 (right value).
After forum update I fixed all database issues.
Other count queries also return 0 counts.
Don't delete any argument. In such case, just insert new indexes. use Hosting cPanel > phpMyAdmin > WP Database > SQL Tab and execute these SQLs:
ALTER TABLE `wp_wpforo_posts` ADD INDEX `topicid_parentid`( `parentid`, `topicid`); ALTER TABLE `wp_wpforo_posts` ADD INDEX `topicid_parentid_guest` ( `parentid`, `topicid`, `status`, `private`);
Make sure the red marked wp_ prefix is correct for your database/
It seems I found the solution. Hope it will help other people.
Yes, this was a database problem. If you have access to phpMyAdmin then login to it.
- Select all tables of your WP installation.
- Choose in tables actions - Check tables.
- Select all tables of your WP installation again.
- Choose in tables actions - Optimize tables.
Now the problem has gone!
Thank you @antonm!
I really appreciate you taking a time and share this information!
This fix worked until a new topic/post is made whereby the pagination disappears again. Have reverted back to the class-posts.php mod as shown at:
Spoke too soon. A new topic reply will once again kill topic pagination until the same cpanel SQL command as below is applied. Have to go back to my class-posts.php fix.
ALTER TABLE `prefix_wpforo_posts` ADD INDEX( `parentid`, `topicid`);
Hi @nando4. I confirm that the problem still exists, but it is irregular. In some topics, pagination works well, in some topics it works only for registered users and doesn't work for guests, but after tables optimization, it begins to work for guests. Something strange...
@robert, please, pay attention to this problem again.
Posted by: antonM
@nando4, could you please write your solution.
What changes did you make in file class-posts.php?
Add comments like shown in class-posts.php. The side effect is any private posts will now be public:
//If doesn't have "View Private Posts" access and not Owner, only return public posts
// $wheres = " " . $table_as_prefix . "`private` = 0";
/////Check Unapproved Post Access////////////////////////////
Thank you nando4. I tried your solution, but on my server, it not works. Unfortunately 🙁
I added double index again as Robert (@robert) wrote, but currently, pagination works only for registered users (i don't use a custom template). For guests, it doesn't work. I disabled and cleared all caches but no result. My tables are InnoDB.
On all other pages of the site, pagination works well. The problem with pagination only appears with wpForo and not in each release. So, I assume that this is actually a wpForo core problem otherwise I would have a pagination problem with all other site's pages.
Check this topic of my forum. It has 37 answers and no pagination. This kills my website traffic 🙁
I'd also recommend increase the memory limit of your WordPress. Then navigate to Dashboard > Forums > Dashboard and click on [Rebuild Threads] button. It may take a long time to do that. Once its done, click on [Delete all caches] button, then delete website caches and check it again as guest.
Also, please let me know, have you changed this forum layout recently?
As i said this is the MySQL server specific cache issue and should be fixed with double indexes. The table optimization doesn't matter. Also, make sure you use InnoDB tables.
If you have a double indexes, then all other rare cases are only related to website or forum cache, they are site cache issues and are not related to wpForo core.
Posted by: nando4
Yes, we have Light Speed cache active. Disabling it isn't an option so the workaround posted above works for us.
Litespeed doesn't work well with wpForo. At least exclude wpForo page.
We found this is not wpForo issue. This is a bug of MySQL 5.6 version.To show pagination it should count the total number of posts, but count(*) on InnoDB tables sometimes returns 0. This bug was reported to MySQL community on 11 Apr 2016. You can see the discussion here: https://bugs.mysql.com/bug.php?id=81031
So the solution is contacting to hosting support and asking them to update MySQL Server to 5.7 version. Or try to change wp_wpforo_posts table to MyISAM engine (not recommended).
@robert, my hosting provider said that it can not update MySQL to 5.7 on shared hosting. It updated 5.6 to the latest version but the result is the same. Another strange thing that the pagination works well for registered users and it worked well in previous releases both for registered and guests 🙁
Don't forget the last time delete woForo cache in Dashboard > Forums > Dashboard admin page. Delete that cache in your website and hosting if you have, then last time optimize wpForo tables in database. And check using other browsers or delete browser cache.