diff options
-rw-r--r-- | CHANGELOG.txt | 4 | ||||
-rw-r--r-- | modules/system/system.module | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d3cf02b89..8dc7d1d40 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,10 @@ Drupal 7.40, xxxx-xx-xx (development version) ----------------------- +- Prevented malformed theme .info files (without a "name" key) from causing + exceptions during menu rebuilds. If an .info file without a "name" key is + found in a module or theme directory, Drupal will now use the module or + theme's machine name as the display name instead. - Made the format column in the {date_format_locale} database table case-sensitive, to match the equivalent column in the {date_formats} table. - Fixed a bug in the Statistics module that caused JavaScript files attached to diff --git a/modules/system/system.module b/modules/system/system.module index c2aa9e07b..d0dda18dc 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2411,6 +2411,10 @@ function _system_rebuild_module_data() { // Merge in defaults and save. $modules[$key]->info = $module->info + $defaults; + // The "name" key is required, but to avoid a fatal error in the menu system + // we set a reasonable default if it is not provided. + $modules[$key]->info += array('name' => $key); + // Prefix stylesheets and scripts with module path. $path = dirname($module->uri); if (isset($module->info['stylesheets'])) { @@ -2546,6 +2550,10 @@ function _system_rebuild_theme_data() { $themes[$key]->filename = $theme->uri; $themes[$key]->info = drupal_parse_info_file($theme->uri) + $defaults; + // The "name" key is required, but to avoid a fatal error in the menu system + // we set a reasonable default if it is not provided. + $themes[$key]->info += array('name' => $key); + // Add the info file modification time, so it becomes available for // contributed modules to use for ordering theme lists. $themes[$key]->info['mtime'] = filemtime($theme->uri); |