1

How can I uninstall the User Badges Module? I always get the same error when I try:

Recoverable fatal error: Argument 1 passed to file_delete() must be an instance of stdClass, string given, called in...

1

Up to Drupal 7 all modules and themes list is stored in system table with there enabled (i.e. 1) / disabled (i.e. 0) status. To Disable your module, set the status to 0 for the module name that you want to disable. Check simple MySQL query below:

UPDATE system SET status='0' WHERE name='module_name';

After running the above query, try emptying the cache tables. You can identify cache tables by table name starting with cache_. To make sure Drupal doesn't try loading from cache.

You can find more details about same on Drupal.org in Disabling or enabling modules manually in the database Or check How to manually uninstall a module? question.

  • It is not advisable to directly set the status in the db. If the module implements hook_uninstall then with direct sql query this hook is not going to run and you will ended up having garbage of data in your db. – Gulok Dec 10 '16 at 22:34
  • @gulok, yes, you're right, but he will at least stop getting error. After that hook_uninstall can be called separately. – Yogesh Dec 11 '16 at 3:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.