diff --git a/core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php b/core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php index fa30909..7ff4c2c 100644 --- a/core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php +++ b/core/lib/Drupal/Core/Block/Plugin/Block/PageTitleBlock.php @@ -9,7 +9,6 @@ use Drupal\Core\Block\BlockBase; use Drupal\Core\Block\TitleBlockPluginInterface; -use Drupal\Core\Form\FormStateInterface; /** * Provides a block to display the page title. diff --git a/core/lib/Drupal/Core/Block/TitleBlockPluginInterface.php b/core/lib/Drupal/Core/Block/TitleBlockPluginInterface.php index ee3dd7c..19ab275 100644 --- a/core/lib/Drupal/Core/Block/TitleBlockPluginInterface.php +++ b/core/lib/Drupal/Core/Block/TitleBlockPluginInterface.php @@ -22,8 +22,8 @@ * Sets the title. * * @param string|array $title - * The page title: either a string for plain titles or a #markup render - * array for formatted titles. + * The page title: either a string for plain titles or a render array for + * formatted titles. */ public function setTitle($title); diff --git a/core/lib/Drupal/Core/Render/Element/PageTitle.php b/core/lib/Drupal/Core/Render/Element/PageTitle.php index 64ff962..27fbf45 100644 --- a/core/lib/Drupal/Core/Render/Element/PageTitle.php +++ b/core/lib/Drupal/Core/Render/Element/PageTitle.php @@ -22,8 +22,8 @@ class PageTitle extends RenderElement { public function getInfo() { return [ '#theme' => 'page_title', - // The page title: either a string for plain titles or a #markup render - // array for formatted titles. + // The page title: either a string for plain titles or a render array for + // formatted titles. '#title' => NULL, ]; } diff --git a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php index d83c2ca..e54f9c1 100644 --- a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php +++ b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php @@ -183,8 +183,8 @@ public function providerBuild() { 'block3' => [], '#sorted' => TRUE, ], - // The main content, messages and title are rendered via the fallback in case - // there are no blocks rendering them. + // The main content, messages and title are rendered via the fallback in + // case there are no blocks rendering them. 'content' => [ 'system_main' => [ '#markup' => 'Hello kittens!', diff --git a/core/modules/system/src/Tests/Update/PageTitleConvertedIntoBlockUpdateTest.php b/core/modules/system/src/Tests/Update/PageTitleConvertedIntoBlockUpdateTest.php index a81af6e..8051168 100644 --- a/core/modules/system/src/Tests/Update/PageTitleConvertedIntoBlockUpdateTest.php +++ b/core/modules/system/src/Tests/Update/PageTitleConvertedIntoBlockUpdateTest.php @@ -57,10 +57,20 @@ public function testUpdateHookN() { // We finished updating so we can login the user now. $this->drupalLogin($this->rootUser); + $page = Node::create([ + 'type' => 'page', + 'title' => 'Page node', + ]); + $page->save(); + // Page title is visible on the home page. $this->drupalGet('/node'); $this->assertRaw('page-title'); + // Page title is visible on a node page. + $this->drupalGet('node/' . $page->id()); + $this->assertRaw('page-title'); + $this->drupalGet('admin/structure/block/list/bartik'); /** @var \Drupal\Core\Config\StorageInterface $config_storage */ diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 0852d39..5d33780 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1694,6 +1694,7 @@ function system_update_8008() { ] + $page_title_default_settings; _system_update_create_block($name, $theme_name, $values); break; + case 'classy': $name = 'block.block.classy_page_title'; $values = [ @@ -1702,11 +1703,12 @@ function system_update_8008() { ] + $page_title_default_settings; _system_update_create_block($name, $theme_name, $values); break; + default: $custom_themes_installed = TRUE; - $name = sprintf('block.block.%s_page_title', $theme_name); + $name = 'block.block.{$theme_name}_page_title'; $values = [ - 'id' => sprintf('%s_page_title', $theme_name), + 'id' => '{$theme_name}_page_title', 'region' => 'content', 'weight' => '-50', ] + $page_title_default_settings; diff --git a/core/themes/bartik/templates/page-title.html.twig b/core/themes/bartik/templates/page-title.html.twig index 73e4acc..e061cd2 100644 --- a/core/themes/bartik/templates/page-title.html.twig +++ b/core/themes/bartik/templates/page-title.html.twig @@ -11,8 +11,6 @@ * - title: The page title, for use in the actual content. * - title_suffix: Additional output populated by modules, intended to be * displayed after the main title tag that appears in the template. - * - * @ingroup themeable */ #} {% set title_attributes = title_attributes.addClass('title') %} diff --git a/core/themes/classy/templates/content/page-title.html.twig b/core/themes/classy/templates/content/page-title.html.twig index 1229bec..adec853 100644 --- a/core/themes/classy/templates/content/page-title.html.twig +++ b/core/themes/classy/templates/content/page-title.html.twig @@ -12,8 +12,6 @@ * displayed after the main title tag that appears in the template. * * @see template_preprocess_page_title() - * - * @ingroup themeable */ #} {{ title_prefix }}