On enabling modules, these error messages are logged:

    * notice: Undefined index: files in includes/registry.inc on line 33.
    * warning: Invalid argument supplied for foreach() in includes/registry.inc on line 33.

This is the code:

function _drupal_rebuild_code_registry() {
  // Reset the resources cache.
  _registry_get_resource_name();
  // Get the list of files we are going to parse.
  $files = array();
  foreach (module_rebuild_cache() as $module) {
    if ($module->status) {
      $dir = dirname($module->filename);
      foreach ($module->info['files'] as $file) { // #33
        $files["./$dir/$file"] = array();
      }

Presumably, the module data generated by module_rebuild_cache will sometimes not contain a files element. I am not sure if this is a bug in the module concerned, or a bug in the registry.

Comments

swentel’s picture

I can reproduce this. This happens when you try to enable a module and the .info is missing the files[] line. I'm not sure if we should add a check on the modules page to see if it has this line or not.

swentel’s picture

I added a comment on another issue, see http://drupal.org/node/229129#comment-967816 . I'll see what they say about this, if it's ok, then we can close this issue.

webchick’s picture

I'd like to see this fixed. There's some code in module_rebuild_cache() that's instantiating a bunch of module .info properties to default values, so this could probably go in there (just instantiated as an array()).

Sorry this got lost in that Evil Monster Issue From Hell (tm).

swentel’s picture

Status: Active » Closed (fixed)

Looks like we can close this one after http://drupal.org/node/229129 got in.
When commenting out all files[] in search.info for example, you can't enable search module, so that's good!