Fatal error while uninstalling module

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
10010110
Translator
Translator
Posts: 215
Joined: Tue Jan 22, 2008 9:57 am

Fatal error while uninstalling module

Post by 10010110 »

I’ve got a site running on CMS 2.2.13 and have a relic module (btAdminer) that I wanted to uninstall because it doesn’t work properly anymore anyway. The process fails with the following error:
PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function CMSModule::RemovePermission(), 0 passed in ~/modules/btAdminer/method.uninstall.php on line 18 and exactly 1 expected in ~/lib/classes/class.CMSModule.php:2954
Stack trace:

Code: Select all

#0 ~/modules/btAdminer/method.uninstall.php(18): CMSModule->RemovePermission()
#1 ~/lib/classes/class.CMSModule.php(1034): include('/homepages/30/d...')
#2 ~/lib/classes/class.moduleoperations.inc.php(901): CMSModule->Uninstall()
#3 ~/modules/ModuleManager/action.local_uninstall.php(30): ModuleOperations->UninstallModule('btAdminer')
#4 ~/lib/classes/class.CMSModule.php(1403): include('/homepages/30/d...')
#5 ~/modules/ModuleManager/ModuleManager.module.php(90): CMSModule->DoAction('local_uninstall', 'm1_', Array, '')
#6 ~/li in ~/lib/classes/class.CMSModule.php on line 2954
How can this be fixed to do a clean uninstall?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Fatal error while uninstalling module

Post by velden »

Looking at the method.install.php file I see it sets two permissions:

$this->CreatePermission('Use btAdminer', 'Use btAdminer');
$this->CreatePermission('Set btAdminer Prefs', 'Set btAdminer Prefs');

Those should be removed by the installer. Note that that's about the only thing the uninstall does in this case.
So consider just to remove the btAdminer folder from /modules/.

Eventually you can remove the two btAdminer permissions manually from the database table cms_permissions.

Of course you should create a database backup before doing so.
10010110
Translator
Translator
Posts: 215
Joined: Tue Jan 22, 2008 9:57 am

Re: Fatal error while uninstalling module

Post by 10010110 »

Thanks much; it’s that easy. :-)
Locked

Return to “Modules/Add-Ons”