From 595b695b17edc6f03ec37b1c6a742d732874910c Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Mon, 3 Aug 2015 19:19:30 +0800 Subject: [PATCH] [#619542] Malformed theme .info files break menu_router generation --- modules/system/system.module | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/system/system.module b/modules/system/system.module index 8fc517f..d80760c 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); -- 2.5.0