Following recent update to drupal 7.50 all disabled modules still present in modules directory resulted in warnings that module-disabled was missing.
While the patch_status module was enabled the warnings could be triggered by running the available updates report.
User warning: The following module-disabled is missing from the file system: advanced_help. In order to fix this, put the module-disabled back in its original location. For more information, see the documentation page (link is external). in _drupal_trigger_error_with_delayed_logging() (line 1125 of /.../includes/bootstrap.inc).
Disabling the patch_status module resolved all warnings.
| Comment | File | Size | Author |
|---|---|---|---|
| #33 | incorrect_missing_module_status-2779259-33.patch | 981 bytes | WorldFallz |
| #13 | incorrect_missing_module_status-2779259-13.patch | 982 bytes | WorldFallz |
| #9 | incorrect_missing_module_status-2779259-9.patch | 964 bytes | WorldFallz |
Comments
Comment #2
izmeez commentedJust changing the title for clarity.
Comment #3
izmeez commentedComment #4
izmeez commentedComment #5
rupertj commentedJust to check, you said disabling patch_status meant the warnings went away. Do they come back if you re-enable patch_status?
Comment #6
izmeez commentedYes. That is correct.
This can be reproduced on a fresh Drupal 7 install by having a contrib module present that is not enabled or installed (e.g. advanced_help) along with patch_status enabled. Leave admin/config/development/logging displaying all messages (to screen). Ensure admin/reports/updates/settings "Check for updates of disabled and uninstalled modules and themes" is checked. Then view available updates report, admin/reports/updates.
Oddly, this not only gives warning about module-disabled but also core missing which of course it is not:
Disabling patch_status makes the warnings go away even if it is not uninstalled.
And flushing caches and re-enabling patch_status causes the the warnings to return.
Hope this helps track down the problem.
Comment #7
izmeez commentedI noticed a different module with a similar issue and a patch for where module_load_include is used, #2782135-5: Incorrect module load causes missing module user warning with 7.50
Comment #8
WorldFallz commentedI too have the same issue. Originally, I thought it was a core issue, till I tried the debugging technique suggested in #2780973-7: User warning: The following core is missing from the file system: drupal. In order to fix this, put the core back in its original location..
Looks like the major change that causes the issue was the switch from drupal_get_path() to drupal_get_filename(). Should be fairly straight forward to figure out which call to drupal_get_path is causing the issue. I'll try to post a patch as soon as I get a chance.
Comment #9
WorldFallz commentedThat turned out to be easy. Attached patch fixes it for me.
Comment #10
izmeez commented@WorldFallz The patch in #9 applies without problems and resolves the missing module warning for disabled and uninstalled modules, but it does not appear to be showing the name of the patch file even for the patch_status module where the new *.patch file is.
I haven't done any more extensive testing but I think it needs more work.
Comment #11
izmeez commentedSorry, just changing status.
Comment #12
WorldFallz commentedOddly, it does show a link for a core patch, but not a contributed module patch (a core patch is what I was testing with). I'll investigate why.
Comment #13
WorldFallz commentedFor some reason the core call doesn't need it, but add dirname() fixes it.
Comment #14
WorldFallz commentedComment #15
izmeez commentedThis is now working for contrib module directories that contain *.patch file(s). In my testing the core directory did not have any *.patch files.
There is another issue where drush make is used and the patches are listed in PATCHES.txt file, #2664996: PATCHES.txt should not need to be world readable which does not behave the same.
Comment #16
izmeez commentedThe patch in #13 solves the issue of modules showing as missing when they are extra modules that are not enabled, or have been disabled and uninstalled but still present in the modules directory.
I am tempted to consider this major since this issue arose with the changes to drupal 7.50 core and can create a number of entries in the watchdog log.
Comment #17
WorldFallz commentedre #15 --- there's probably a separate drupal_get_path call for that. I don't use the module that way, but I'll see if I can figure out which one it is.
Comment #19
rupertj commentedThanks both! I've pushed a slightly different fix to the 7.x-1.x branch, as I don't think it's right to suppress the warning for actual missing modules. Obviously the one about a "missing core" is totally wrong though, so I've used the same mechanism that's used earlier in the code for the special case for core to stop that happening.
Comment #20
WorldFallz commentedEven better-- thanks for the quick turnaround rupertj!
Comment #21
izmeez commentedTested the new release and it does not solve the problem in the issue opening description, disabled modules showing as missing.
The oddity described in comment #6 "... The following core is missing ..." appears to be resolved.
Comment #22
rupertj commentedCould you make a separate issue for that? This thread's getting pretty confusing as it is. Thanks!
Comment #23
izmeez commented@rupertj Sorry, I am not going to repeat myself with a new thread.
I do not know how the issue can be expressed more clearly than it has. I have answered questions for more information. Comment #6 described how to reproduce the issue on a fresh install. I have reviewed and tested patches.
The "fix" was not provided as a patch for testing and review. Maybe the "fix" should explain what it was intended to fix. I think this issue has been hijacked by a fix that does not address the issue. If the "fix" fixes part of the problem fair enough, but it still needs work to fix the main problem, disabled modules trigger missing module warning!
I have changed the status back to "Needs work".
Sad to see a useful module hit the rocks like this.
Comment #24
fabianx commentedI would suggest to do the following, which is more clean:
or something along the lines.
I am not sure the patch_status for disabled modules is needed. In case it is, the solution in the patches expressed above would also solve the problem.
Comment #25
izmeez commented@Fabianx Thanks for your added comments.
I think it is helpful to show patch_status for disabled modules to clearly show their status and to keep consistency whether the module is enabled or disabled.
Comment #26
WorldFallz commentedYep, it seems my initial response was premature, lol.
Testing the latest dev with simplytest.me I actually don't get the message on missing core or disabled modules any more.
However, I do still get it with an enabled node clone module who's project name and file directory are "node_clone" but who's actual module is named "clone" (ie clone.module, clone.install, clone.info).
Steps to reproduce are exactly the same as izmeez described above
Comment #27
izmeez commentedIs it this part of the new commit that needs further work?
Comment #28
izmeez commentedI've added the 2nd part of the patch in #13 to the current dev.
This fixes the issue.
The fix that was committed is not as succinct as the patch offered in #13 while it adds another function that may add readability but does not incorporate the full change in the first part of #13.
I would suggest an alternative for the commit,
This is essentially the same as the patch in #13 with the variable name change from $patch_link_name to $patch_link_path.
If it is decided to add the new function patch_status_get_path the following lines need review,
Comment #29
fabianx commentedI think this should iterate over all modules in a project and not the projects itself. Then the workaround would not be needed.
Comment #30
izmeez commented@Fabianx I understand the concept you present but can you identify how it should be implemented? Thanks.
Comment #31
izmeez commentedJust adding the reference to the pertinent change record, Performance improvements for drupal_get_filename() https://www.drupal.org/node/2581445
Comment #32
aitala commented#28 seems to work for me...
Eric
Comment #33
WorldFallz commentedHaven't looked into implementing #29 yet, but here's a current patch for #28 for ease of maintenance for the time being. Applies to both 7.x-1.x and 7.x-1.1 as of now.