开发者

How to uninstall a module that overrides the core user module?

开发者 https://www.devze.com 2023-01-13 06:53 出处:网络
One of my developers wanted to override some functiona开发者_开发问答lity of the core user module. He made a copy of the core user module and placed it in the sites/all/modules folder. Something in th

One of my developers wanted to override some functiona开发者_开发问答lity of the core user module. He made a copy of the core user module and placed it in the sites/all/modules folder. Something in the functionality screwed up and now I am not sure how to uninstall it. I have tried deleting the module from the sites/all/modules folder and it now crashes the site. I then edit the systems table to make sure all entries point to the original user module but now I have problems with the user module and weird anomalies. Is it a bad practice to override core modules? Are there any other tables that need to be cleaned? What is a sure shot way of removing a module which cannot be removed via Admin control panel as in this case the overriden user module never appears in the module list.


Is it a bad practice to override core modules?

Yes. Do not override core modules: Bad Things (like what you have now) happen.

Are there any other tables that need to be cleaned?

This is impossible to tell without knowing the code in your version of the user module, but even knowing it the damage has already been done.

What is a sure shot way of removing a module which cannot be removed via Admin control panel as in this case the overriden user module never appears in the module list.

Normally, if you can't access the module administration page for whatever reason, you'd run the following to uninstall the module:

module_load_install($module);
$versions = drupal_get_schema_versions($module);
drupal_set_installed_schema_version($module, SCHEMA_UNINSTALLED);
module_invoke($module, 'uninstall');

Then delete the overriding module's files and re-install the original module. You have to delete the files after running the uninstall hooks because the files contain the code that needs to be performed during the uninstall.

However, since you've overridden the user module, you're in a really bad place, as you can't uninstall the user module: required core modules are not meant to be tampered with.

So, the surefire way to get out of the mess you're currently in is to delete the overriding module and restore from a previous database backup.

0

精彩评论

暂无评论...
验证码 换一张
取 消