MyBB Community Forums

Full Version: Inaccurate activated plugin count in upgrade.php for 1.2.2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I went to upgrade it said I had 14 plugins activated so to be on the safe side I deactivated all the ones I had.

I noticed that I only have 10 installed so naturally can't have 14 activated. When I went back to upgrade it said I still had 5 activated, but since I didn't have any more to deactivate I went ahead and it worked as expected.

Any ideas???
if($db->table_exists(TABLE_PREFIX."datacache"))
{
	require_once MYBB_ROOT."inc/class_datacache.php";
	$cache = new datacache;
	$plugins = $cache->read('plugins', true);
	if(!empty($plugins['active']))
	{
		$lang->upgrade_welcome = "<div class=\"error\"><strong><span style=\"color: red\">Warning:</span></strong> <p>There are still ".count($plugins['active'])." plugin(s) active. Active plugins can sometimes cause problems during an upgrade procedure.</p></div> <br />".$lang->upgrade_welcome;
	}
}

I think you've removed plugin files without deactivating them causing an incorrect count in the active plugin cache or the plugin is screwed up (meaning it didn't remove properly from the list because of a deactivation error). The code is correct, but anyway the plugins didn't need to be deactivated. In the next release we'll only have it show up for releases that need plugins to be disabled (because of changes that may cause errors on the board because of a plugin)
Is there anyway I can remove the plugins data from the cache?

I've looked at the sql table and it's all gobbledy-gook.........

With none of the plugins activated in the Control Panel, the plugin field in the datacache table looks like this:
a:1:{s:6:"active";a:5:{s:2:"ei";s:2:"ei";s:16:"advanced_plugins";s:16:"advanced_plugins";s:4:"mfdp";s:4:"mfdp";s:12:"plugpmreport";s:12:"plugpmreport";s:13:"prune_members";s:13:"prune_members";}}
Actually that is a serialized array, and by looking at it, it thinks you still have the following plugins active because you removed them improperly:

advanced_plugins (2 times)
mfdp (2 times)
plugpmreport (2 times)
prune members (2 times)

Just replace the contents of it with N; if you absolutely sure that all of your plugins are deactivated.
Thanks, did just that.

Will let my other admin know...........I think they deleted the plugins without deactivating them

Is there any reason why each plugin appears twice.

It does it even when I reset the field to N; and then reactivated the plugins.