summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-10-11 16:30:18 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-10-11 16:30:18 -0400
commite88bbeaa083c9d8309b6879259c460ca977410f3 (patch)
tree711c8d367e28b39532441436cd7558411328ecbe
parent6379101933142e2eeaea2f4eb41f4d32a9e47531 (diff)
downloadbrdo-e88bbeaa083c9d8309b6879259c460ca977410f3.tar.gz
brdo-e88bbeaa083c9d8309b6879259c460ca977410f3.tar.bz2
Issue #619542 by dcrocks, bfroehle, catch, amontero, jayeshanandani, malcomio, JohnAlbin, olamaekle: Malformed theme .info files break menu_router generation
-rw-r--r--CHANGELOG.txt4
-rw-r--r--modules/system/system.module8
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);