After Upgrading to Drupal 7.50 (or Later), I Get Missing Module Warnings

Drupal Version

Issue

After upgrading to Drupal 7.50 (or later), you start seeing red error messages that read "The following module is missing from the file system...".

Drupal 7.50 began scanning more carefully for module and theme files, including files for modules and themes that had been disabled, but not uninstalled.  Unfortunately, many Drupal site administrators have disabled and deleted modules in the past without running the uninstall process, and once the module has been deleted, you no longer have a way to uninstall it.

Solution

  • If the module listed is "mymodule", then the issue is most likely with the GT Tools module (specifically, the GT Content Types sub-module of GT Tools).  Upgrade your site to the latest version of GT Tools, and that should fix the problem.

  • For other modules and themes, the easiest solution is to download a copy of the module or theme in question, install it back into your website's filesystem, then go to Modules -> Uninstall on the administration menu bar and uninstall that module.  You can then delete the module or theme from your filesystem.

  • If you cannot obtain the a copy of the module again (e.g. it was a locally written custom module, and all copies have been deleted), you can suppress the error messages by updating your database (WARNING: Back up your database before attempting this proceedure!)

    Via whichever MySQL tool you prefer to use (e.g. phpMyAdmin), run the following SQL commands against your Drupal database (replace 'XXXX' with the relative path from the Drupal site root directory to the module or theme in question -- e.g., "sites/all/modules/ctools"):

    DELETE FROM `system` WHERE filename like 'XXXXXX';
  • If the missing object is a Drupal profile (e.g. "gt_profile" or "gt_install"), then fixing the problem is a little trickier.  Please see the article on fixing a missing profile in Drupal 7.