• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed  "Moderation Queue" doesn't get rebuilt when key is missing in Data Registry


Well-known member
If the "moderationCounts" key is missing from the data registry, it doesn't get rebuilt when _updateModeratorSessionCaches() is called in the abstract public controller. (executed on each page load)

In XenForo_Dependencies_Public::_handleCustomPreloadedData(), we have:
XenForo_Application::set('moderationCounts', $data['moderationCounts']);
which sets the moderationCounts to null, in case the data is missing.
And in XenForo_ControllerPublic_Abstract::_updateModeratorSessionModerationCounts(), we have:
		if (XenForo_Application::isRegistered('moderationCounts'))
which always returns true (because it seems it doesn't check for null values). This prevents the cache from being rebuilt. I believe this is a bug; even though I can't find any situation where this data registry key gets deleted (except when running a delete query manually).


XenForo developer
Staff member
The same logic seems to apply to report counts too. They'll now only be registered if they're arrays.