MyBB Community Forums

Full Version: [F] is_moderator is not cached
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It seems that moderator permission of each forum is not cached, therefore if a site has 50 forums and subforums, if a user access to index.php, MyBB will do at least 50 queries to obtain is_moderator of that forum. The problem comming from get_moderator_permissions functions and is_moderator function in functions.php. Should we do some caching here?
If a user is not admin and super modder, it will generate alot of queries if there are many sub-forums especially the index.php.

These similar queries just repeat many times:

 SELECT * FROM mybb_moderators WHERE uid='123' AND (fid='5' OR fid='7' OR fid='19' ....)

You can take a look at my site at . I also activate debug info for registered users so you will know what's wrong. Currently it generate more than 70 queries in that index forum even I turned the modlist off.
Ok let's start this thread all over again (I split the other posts here).

Tikitiki's working on a fix for this.
This bug has been fixed in the latest code.

Please note the latest code is not live on the site or for download. An update will be released which contains this fix.
May you show me how to fix this one?
This issue is not solved in MyBB 1.2.7 yet. It's still using many queries to obtain is_moderator forums and subforums. You can take a look here. I created some forum for testing.
(The testing forum is on a free server which is not stable, You may have to try some times to reach this page)
This is only fixed for MyBB 1.4 because it requires a rewrite of the Moderator Cache and that is also why you didn't receive a response for a fix.
I asked so because it was listed in Fixed Bug List in MyBB 1.2.7 Released - Security & Maintenance Release.
So if it is not fixed yet. It should be taken out of that list.

Best Regards,
Good, Tikitiki.