diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 8084831..abc5652 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1136,7 +1136,11 @@ function system_system_info_alter(&$info, Extension $file, $type) { } /** - * Gets the name of the default region for a given theme. + * Gets the name of the default region for a given theme, which will be one of: + * A region name specified by 'block_default_region' in the theme's info.yml + * The name of the first region specified in the theme's info.yml. + * An empty string '' if the theme has no regions. + * * * @param $theme * The name of a theme. @@ -1147,10 +1151,10 @@ function system_default_region($theme) { $regions = array_keys(system_region_list($theme, REGIONS_VISIBLE)); $info = system_get_info('theme', $theme); if (isset($info['block_default_region']) && in_array($info['block_default_region'], $regions)) { - return $info['block_default_region']; - } + return $info['block_default_region']; + } else { - return isset($regions[0]) ? $regions[0] : ''; + return isset($regions[0]) ? $regions[0] : ''; } }