The modules gives the following message when it doesn't find anything:

Notice: Undefined variable: modules in module_missing_message_fixer_form_submit() (line 112 of /home/username/public_html/sites/all/modules/module_missing_message_fixer/includes/module_missing_message_fixer.admin.inc).

Not sure the submitted patch is the most elegant way, but it takes care of the error.

CommentFileSizeAuthor
#2 2767987.patch518 bytesnickonom
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nickonom created an issue. See original summary.

nickonom’s picture

Issue summary: View changes
FileSize
518 bytes
nickonom’s picture

Unfortunately, the message

The following module is missing from the file system: MODULE NAME.

is still there because there are number of other tables where incorrectly uninstalled modules leave their traces. In my case it was advanced queue table.

I believe it will be difficult to come up with more "universal" solution as you have to check different tables for different websites.

joelpittet’s picture

Status: Active » Needs review
nickonom’s picture

Issue summary: View changes

If possible please make that activation of the module also clears cache tables.

labboy0276’s picture

Assigned: Unassigned » labboy0276
Status: Needs review » Closed (won't fix)

If you use the 1.1 version, this issue was resolved already.

nickonom’s picture

Issue summary: View changes
Status: Closed (won't fix) » Needs review

If you use the 1.1 version, this issue was resolved already.

labboy0276, here is how exactly the faulty line 112 from the 1.1 version looks like ( please see http://cgit.drupalcode.org/module_missing_message_fixer/tree/includes/mo...):

 if (count($modules) > 0) {
    db_delete('system')
      ->condition('name', $modules, 'IN')
      ->execute();
  }

And it gives the reported messages, because when there are no modules then "modules" becomes undefined variable. And that is exactly why the proposed patch gives:

--- module_missing_message_fixer.admin.inc.orig 2016-07-17 20:44:37.697320803 -0700
+++ module_missing_message_fixer.admin.inc      2016-07-17 20:47:57.196318296 -0700
@@ -109,9 +109,11 @@
   }
 
   // Delete if there is no modules.
-  if (count($modules) > 0) {
-    db_delete('system')
-      ->condition('name', $modules, 'IN')
-      ->execute();
+  if (isset($modules)) {
+    if (count($modules) > 0) {
+      db_delete('system')
+        ->condition('name', $modules, 'IN')
+        ->execute();
+    }
   }
 }

So please run simple comparison before closing this and marking won't fix.

labboy0276’s picture

I stand corrected, I forgot to put the s on modules in the opening declaration:

Was:

$module = array();

Now

$modules = array();

It is in dev, please check and let me know.

nickonom’s picture

Ramya Bala’s picture

I tested this patch and Its working fine. This module is working great

rubantin’s picture

I am very green at linux and drupal...I installed kickstart and got a bunch of missing module messages during setup. I install message fixer module and when I click "remove these errors" i get a warning:

Notice: Undefined variable: modules in module_missing_message_fixer_form_submit() (line 112 of C:\wamp\www\naturalwaymills\sites\all\modules\module_missing_message_fixer\includes\module_missing_message_fixer.admin.inc).

So, I installed Cygwin and neccesary ultils..

I put the 2767987.patch in the module_missing_message_fixer directory, opened cygwin and went to the directory and tried installing the patch. The following are my attempts.

$ patch -p0 < 2767987.patch
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- module_missing_message_fixer.admin.inc.orig 2016-07-17 20:44:37.697320803 -0700
|+++ module_missing_message_fixer.admin.inc 2016-07-17 20:47:57.196318296 -0700
--------------------------
File to patch: ls
ls: No such file or directory
Skip this patch? [y] n
File to patch: module_missing_message_fixer.module
patching file module_missing_message_fixer.module
Hunk #1 FAILED at 109.
1 out of 1 hunk FAILED -- saving rejects to file module_missing_message_fixer.module.rej

Russ@DESKTOP-V07UC3T /cygdrive/c/wamp/www/naturalwaymills/sites/all/modules/module_missing_message_fixer
$ ^C

Russ@DESKTOP-V07UC3T /cygdrive/c/wamp/www/naturalwaymills/sites/all/modules/module_missing_message_fixer
$ patch < 2767987.patch
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- module_missing_message_fixer.admin.inc.orig 2016-07-17 20:44:37.697320803 -0700
|+++ module_missing_message_fixer.admin.inc 2016-07-17 20:47:57.196318296 -0700
--------------------------
File to patch: patch -strip <2767987.patch
patch -strip <2767987.patch: No such file or directory
Skip this patch? [y] y
Skipping patch.
1 out of 1 hunk ignored

Russ@DESKTOP-V07UC3T /cygdrive/c/wamp/www/naturalwaymills/sites/all/modules/module_missing_message_fixer
$ pstch - strip < 2767987.patch
-bash: pstch: command not found

Russ@DESKTOP-V07UC3T /cygdrive/c/wamp/www/naturalwaymills/sites/all/modules/module_missing_message_fixer
$ patch -strip < 2767987.patch
The text leading up to this was:
--------------------------
|--- module_missing_message_fixer.admin.inc.orig 2016-07-17 20:44:37.697320803 -0700
|+++ module_missing_message_fixer.admin.inc 2016-07-17 20:47:57.196318296 -0700
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored

What am I doing wrong?

labboy0276’s picture

Status: Needs review » Closed (fixed)

You don't need to use the patch here, just use the dev version.

rubantin’s picture

where do i get the dev version?

labboy0276’s picture

https://www.drupal.org/project/module_missing_message_fixer

The dev version is the one that is 7.x-1.x-dev

rubantin’s picture

NVM.. found it

rubantin’s picture

NVM.. would like to delete ignorant posts of mine

joelpittet’s picture

@rubantin The thing you were missing is you need the -p1 flag and need to be in the module's directory. Looked like you almost got it though!

There is some further documentation here: https://www.drupal.org/patch/apply

Dev version is usually on the project's home page, you can also download with drush or composer if you use those, but that could be a bit trickier to describe.

rubantin’s picture

ok.. had several spurious errors.. so, I did a fresh install of kickstart and installed the fixer module. After installing it, I was given the successful indication page and clicked on the "enable newly installed module" link.

When the module page oaded, I got the error warning at the top of the modules page:

User warning: The following module has moved within the file system: module_missing_message_fixer. In order to fix this, clear caches or put the module back in its original location. For more information, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1128 of /hermes/bosnaweb09a/b10/ipg.humbleberryfarmscom/naturalwaymills/includes/bootstrap.inc).

I have not went any further. Have not attempted to enable it o anything.. What should I do next?

labboy0276’s picture

It is hard to tell, you didn't do something right and moved the module around. The message tells you whats up basically.

It seems based on your questions you are new to Drupal. I would suggest spending a few bucks and obtain a membership to https://drupalize.me/ This will save you a bunch of time and headaches by watching all their intro to Drupal videos. It is a great resource for someone getting started.