Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2008 at 12:49 UTC
Updated:
10 Nov 2008 at 16:40 UTC
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
Comment #1
swentel commentedI 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.
Comment #2
swentel commentedI 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.
Comment #3
webchickI'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).
Comment #4
swentel commentedLooks 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!