diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 373de1d..7ea809a 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2125,6 +2125,7 @@ function template_preprocess_page(&$variables) { // Move some variables to the top level for themer convenience and template cleanliness. $variables['show_messages'] = $variables['page']['#show_messages']; + $variables['title'] = $variables['page']['#title']; foreach (system_region_list($GLOBALS['theme']) as $region_key => $region_name) { if (!isset($variables['page'][$region_key])) { @@ -2154,13 +2155,6 @@ function template_preprocess_page(&$variables) { $variables['site_slogan'] = (theme_get_setting('features.slogan') ? filter_xss_admin($site_config->get('slogan')) : ''); $variables['tabs'] = menu_local_tabs(); - if (isset($variables['page']['#title'])) { - $variables['title'] = $variables['page']['#title']; - } - else { - $variables['title'] = ''; - } - // Pass the main menu and secondary menu to the template as render arrays. if (!empty($variables['main_menu'])) { $variables['main_menu'] = array( diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php index a6dd308..d19d17f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderElementTypesTest.php @@ -229,7 +229,7 @@ function testMaintenancePage() { '!front_page' => url(), '!logo' => theme_get_setting('logo.url'), '!site_name' => $site_config->get('name'), - '!title' => $title ? '

' . $title . '

' : '', + '!title' => $site_name ? '

' . String::checkPlain($site_name) . '

' : '', '!content' => 'foo', ); diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 67b25fe..cd77d88 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -282,6 +282,7 @@ function system_element_info() { $types['page'] = array( '#show_messages' => TRUE, '#theme' => 'page', + '#title' => '', ); // By default, we don't want Ajax commands being rendered in the context of an // HTML page, so we don't provide defaults for #theme or #theme_wrappers.