MyBB Community Forums

Full Version: Error when deactivating plugins.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I receive this error:
Fatal error: Cannot redeclare find_replace_templatesets() (previously declared in /home/inusekai/public_html/pokecosmo.com.ar/foros/inc/adminfunctions_templates.php:22) in /home/inusekai/public_html/pokecosmo.com.ar/foros/inc/adminfunctions_templates.php on line 101

I can go back without problems.
I have just try it whit two, I think there is a error when removing html, uploading a frech copy of "adminfunctions_templates.php" doesn't work.
This error is slapped when you've two equal functions, for example, any plugin, plugin x and plugin y, if both have a similar function called, plugin1_activate, it is threw, have you added some new plugin? There is a declaration issue within it maybe.
I have the same plugins in two of my forums, and this error is not show in the other :|
If the plugin use this code:
require MYBB_ROOT . "inc/adminfunctions_templates.php";
in the activate and/or the deactivate function, try to change the require to require_once.
Both plugins runs this code instead:
include MYBB_ROOT."/inc/adminfunctions_templates.php";

Could there be any problems if I change it? Of course I will try to :p
It should say include_once/require_once instead of include/require
Then change it to include_once. Or comment the line out entirely. (I've written code that throws this error, it's not a difficult bug to create. Usually it's because the file is already included and you don't need the include line at all.)
Ok, I managed to deactivate the plugin, but can you explain why this happens?

I mean, deactivating the same plugins in a forum worked, but not for this one.
It maybe an issue in start on first forum, your second forum may catch it along the way. Technically require isn't needed, because it'd tell db to fetch every time it is loaded, instead you or the plugin author, should use require_once , plugins only require them twice, once for activating, second for deactivating (only in some cases), so there is an issue on require end.
Pages: 1 2