Notifications
Clear all

wpForo 1.x.x [Solved] Topic pages disappeared

40 Posts
7 Users
14 Reactions
9,672 Views
antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 8 years ago

Hi guys!

@robert, after last update topic's pages disappeared in Q&A layout. You can check this problem in this topic on my forum. How to quickly resolve this issue? My users can't navigate in big topics.

39 Replies
Sofy
Posts: 4900
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @antonm,

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. 

5 Replies
antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

Hi Sofy,

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.

Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4900

@antonm,

Could you please send admin login details to info[at]gvectors.com email address to allow us to check it. 

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

I assume, that the problem related to new DB structure.
I examined SQL queries and found that for example this one:

SELECT count(*)
FROM `prefix_wpforo_posts`
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.

Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

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/

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

Hi Robert,

all these manipulations were made in phpMyAdmin, not in the wpForo code.

So, don't worry. All works properly.

antonM
Posts: 131
Topic starter
(@antonm)
Estimable Member
Joined: 8 years ago

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!

20 Replies
Sofy
 Sofy
Admin
(@sofy)
Joined: 7 years ago

Support Team
Posts: 4900

Thank you @antonm!

I really appreciate you taking a time and share this information!

(@nando4)
Joined: 8 years ago

Estimable Member
Posts: 111

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:

https://wpforo.com/community/how-to-and-troubleshooting-2/guest-login-topic-pagination-missing-for-extended-layout/

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

nando4, I confirm this.

Please, use Robert's solution that showed above. Create an additional index for wpforo_posts table. It works perfectly.

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

Don't forget to change the prefix to that is used in your database.

(@nando4)
Joined: 8 years ago

Estimable Member
Posts: 111

@antonM, that indeed got topic pagination back that is maintained even after new posts are added to the DB. thank you so much. 

(@nando4)
Joined: 8 years ago

Estimable Member
Posts: 111

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`);
antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

nando4, this solution is still working for me.

Don't forget to change the prefix according to your WP installation.

ALTER TABLE `prefix_wpforo_posts` ADD INDEX( `parentid`, `topicid`);
(@nando4)
Joined: 8 years ago

Estimable Member
Posts: 111

Yes, did that. It fixes topic pagination until a topic has a new post in it and then it's back to permanently disappearing.

So I've altered class-posts.php to not do a private=0 status lookup that's causing items_count=0 to be returned. Not elegant, but it works.

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

I hope @robert will take a look at this problem again. But I think this is a DB problem.

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

Do you delete all caches? Try to disable all caches, clear them and check pagination again.

(@nando4)
Joined: 8 years ago

Estimable Member
Posts: 111

Yes, deleted/disabled cache. Makes no difference.

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

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.

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

@nando4, could you please write your solution.

What changes did you make in file class-posts.php?

Thanks.

(@nando4)
Joined: 8 years ago

Estimable Member
Posts: 111
Posted by: antonM

@nando4, could you please write your solution.

What changes did you make in file class-posts.php?

Thanks.

 

Add comments like shown in class-posts.php. The side effect is any private posts will now be public:

// else{
//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////////////////////////////

 

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

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 🙁

Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

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?

antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

Hi Robert. I made all manipulations and no result for guests. I just made some minor modifications such as adding Google ads or similar not related to pagination. I also tried without any caches and the results are the same.

Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

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.

(@nando4)
Joined: 8 years ago

Estimable Member
Posts: 111

Yes, we have Light Speed cache active. Disabling it isn't an option so the workaround posted above works for us.

(@anonymous20)
Joined: 9 years ago

Noble Member
Posts: 1602
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.

Robert
Posts: 10591
Admin
(@robert)
Support Team
Joined: 9 years ago

@antonm, @nando4 and @anonymous20,

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).

2 Replies
antonM
(@antonm)
Joined: 8 years ago

Estimable Member
Posts: 131

@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 🙁

Robert
Admin
(@robert)
Joined: 9 years ago

Support Team
Posts: 10591

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.

Posts: 111
(@nando4)
Estimable Member
Joined: 8 years ago

@robert , have upgraded from mySQL 5.6 to 5.7. After 12 hrs of operation, the topic pagination has remained. So tentatively appears to have solved the problem.

Page 1 / 2