MyBB Community Forums

Full Version: Stats page refreshing issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Reproduce
  • Admin Control Panel > Configurations > Statistiscs Page > Stats Limit
  • See Stats Limit is 15 by default.
  • Change it to 30.
  • See in Stats Page it's still 15.
  • Go back and change it to 45.
  • See in Stats Page it's 30 now.
  • Go back and change it to 60.
  • See in Stats Page it's 45 now.
  1. It always shows the limit saved one before than actual setting.
  2. If you save the settings twice, it shows the actual value since one before is same as actual one.
It seems the cache is updated before the new setting has been saved.

I fixed it for my forums by replacing this part in admin/modules/config/settings.php:


if(isset($mybb->input['upsetting']['statslimit']) && $mybb->input['upsetting']['statslimit'] != $mybb->settings['statstopreferrer'])
{
	$cache->update_most_replied_threads();
	$cache->update_most_viewed_threads();
}

rebuild_settings();

with this code:

$statslimit = 0;
if(isset($mybb->input['upsetting']['statslimit']) && $mybb->input['upsetting']['statslimit'] != $mybb->settings['statslimit'])
{
	$statslimit = 1;
}

rebuild_settings();

if($statslimit == 1)
{
	$cache->update_most_replied_threads();
	$cache->update_most_viewed_threads();
}
I can confirm that!
Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/2642

Thanks for contributing to MyBB!

Regards,
The MyBB Group