Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291123

module_enable() silently fails if a module isn't in the file system

$
0
0

Let's say you enable three modules in module_enable().

If one of them isn't in the file system, this is what happens:

   if (!isset($module_data[$module])) {
        // This module is not found in the filesystem, abort.
        return FALSE;
      }

No error gets thrown at all, and the rest of the modules don't get enabled either.

In my case this happened when a new module wasn't checked in to git, then a subsequent update called a function in it - the first error you get is the fatal error undefined function.

It probably makes sense to do a complete abort to avoid sites getting in a completely unrecoverable state, but could probably throw an expection instead of the return FALSE there.

This is less of an issue when only enabling one module - it's pretty obvious if it doesn't get enabled when it's not in the filesystem, but when it's a different module that happens to be enabled by the same function call but which otherwise would have been enabled without complaint it's a bit odd.


Viewing all articles
Browse latest Browse all 291123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>