diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 87b3b18..61f5b2f 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2836,11 +2836,8 @@ function theme_get_suggestions($args, $base, $delimiter = '__') { * - content - An array of page content. */ function template_preprocess_maintenance_page(&$variables) { - global $theme; $language_interface = language(Language::TYPE_INTERFACE); - // Retrieve the theme data to list all available regions. - $theme_data = list_themes(); - $regions = $theme_data[$theme]->info['regions']; + $site_config = Drupal::config('system.site'); // Add favicon if (theme_get_setting('features.favicon')) { @@ -2849,11 +2846,14 @@ function template_preprocess_maintenance_page(&$variables) { drupal_add_html_head_link(array('rel' => 'shortcut icon', 'href' => drupal_strip_dangerous_protocols($favicon), 'type' => $type)); } - // Get all region content set with drupal_add_region_content(). - foreach (array_keys($regions) as $region) { - // Assign region to a region variable. - $region_content = drupal_get_region_content($region); - isset($variables[$region]) ? $variables[$region] .= $region_content : $variables[$region] = $region_content; + foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) { + if (!isset($variables[$region_key])) { + $variables[$region_key] = array(); + } + // Append region content set with drupal_add_region_content() as markup. + if ($region_content = drupal_get_region_content($region_key)) { + $variables[$region_key][]['#markup'] = $region_content; + } } // Setup layout variable. @@ -2865,11 +2865,9 @@ function template_preprocess_maintenance_page(&$variables) { $variables['layout'] = ($variables['layout'] == 'first') ? 'both' : 'second'; } - $site_config = Drupal::config('system.site'); + // Construct the page title. $site_name = $site_config->get('name'); $site_slogan = $site_config->get('slogan'); - - // Construct the page title. if (isset($variables['page']['#title'])) { $head_title = array( 'title' => strip_tags($variables['page']['#title']),