diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 2c8f3fd..baeabf6 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1470,17 +1470,6 @@ function template_preprocess_page(&$variables) { '#theme' => 'status_messages', '#access' => $variables['show_messages'], ); - - // Set the breadcrumb last, so as to increase the chance of being able to - // re-use the cache of an already retrieved menu containing the active link - // for the current page. - // @see menu_tree_page_data() - if (!defined('MAINTENANCE_MODE')) { - $variables['breadcrumb'] = array( - '#theme' => 'breadcrumb', - '#links' => \Drupal::service('breadcrumb')->build(\Drupal::routeMatch()), - ); - } } /** diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php index 8beb184..36c286e 100644 --- a/core/lib/Drupal/Core/Extension/ThemeHandler.php +++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php @@ -460,6 +460,7 @@ public function rebuildThemeData() { 'help' => 'Help', 'page_top' => 'Page top', 'page_bottom' => 'Page bottom', + 'breadcrumb' => 'Breadcrumb', ), 'description' => '', 'features' => $this->defaultFeatures, diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index 44c71ec..0f349b1 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -52,8 +52,12 @@ class BookTest extends WebTestBase { */ protected $adminUser; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // node_access_test requires a node_access_rebuild(). node_access_rebuild(); diff --git a/core/modules/comment/src/Tests/CommentNonNodeTest.php b/core/modules/comment/src/Tests/CommentNonNodeTest.php index 9189d42..19c9e39 100644 --- a/core/modules/comment/src/Tests/CommentNonNodeTest.php +++ b/core/modules/comment/src/Tests/CommentNonNodeTest.php @@ -33,8 +33,12 @@ class CommentNonNodeTest extends WebTestBase { */ protected $admin_user; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // Create a bundle for entity_test. entity_test_create_bundle('entity_test', 'Entity Test', 'entity_test'); diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php index 1909a46..3ab9691 100644 --- a/core/modules/contact/src/Tests/ContactSitewideTest.php +++ b/core/modules/contact/src/Tests/ContactSitewideTest.php @@ -31,6 +31,14 @@ class ContactSitewideTest extends WebTestBase { public static $modules = array('text', 'contact', 'field_ui', 'contact_test'); /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); + } + + /** * Tests configuration options and the site-wide contact form. */ function testSiteWideContact() { diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php index ec34a6c..fca1d35 100644 --- a/core/modules/dblog/src/Tests/DbLogTest.php +++ b/core/modules/dblog/src/Tests/DbLogTest.php @@ -42,8 +42,12 @@ class DbLogTest extends WebTestBase { */ protected $webUser; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // Create users with specific permissions. $this->adminUser = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports', 'administer users')); diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceAdminTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceAdminTest.php index a13a75b..2cd15d6 100644 --- a/core/modules/entity_reference/src/Tests/EntityReferenceAdminTest.php +++ b/core/modules/entity_reference/src/Tests/EntityReferenceAdminTest.php @@ -38,8 +38,12 @@ class EntityReferenceAdminTest extends WebTestBase { */ protected $type; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // Create test user. $admin_user = $this->drupalCreateUser(array('access content', 'administer node fields', 'administer node display')); diff --git a/core/modules/field_ui/src/Tests/ManageDisplayTest.php b/core/modules/field_ui/src/Tests/ManageDisplayTest.php index e628757..c1af14f 100644 --- a/core/modules/field_ui/src/Tests/ManageDisplayTest.php +++ b/core/modules/field_ui/src/Tests/ManageDisplayTest.php @@ -33,6 +33,7 @@ class ManageDisplayTest extends WebTestBase { */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // Create a test user. $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access')); diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index 335b63b..539d51d 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -35,6 +35,7 @@ class ManageFieldsTest extends WebTestBase { */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // Create a test user. $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access')); diff --git a/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php index c3ce5f0..f0a4ef1 100644 --- a/core/modules/file/src/Tests/FileFieldWidgetTest.php +++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php @@ -23,6 +23,14 @@ class FileFieldWidgetTest extends FileFieldTestBase { use FieldUiTestTrait; /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); + } + + /** * Modules to enable. * * @var array diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php index c716f5a..ffbeaed 100644 --- a/core/modules/forum/src/Tests/ForumTest.php +++ b/core/modules/forum/src/Tests/ForumTest.php @@ -67,8 +67,12 @@ class ForumTest extends WebTestBase { */ protected $nids; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // Create users. $this->admin_user = $this->drupalCreateUser(array( diff --git a/core/modules/link/src/Tests/LinkFieldUITest.php b/core/modules/link/src/Tests/LinkFieldUITest.php index 1f7c3c1..6a6fa38 100644 --- a/core/modules/link/src/Tests/LinkFieldUITest.php +++ b/core/modules/link/src/Tests/LinkFieldUITest.php @@ -27,8 +27,12 @@ class LinkFieldUITest extends WebTestBase { */ public static $modules = array('node', 'link', 'field_ui'); + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); $this->web_user = $this->drupalCreateUser(array('administer content types', 'administer node fields', 'administer node display')); $this->drupalLogin($this->web_user); diff --git a/core/modules/node/src/Tests/NodeTitleTest.php b/core/modules/node/src/Tests/NodeTitleTest.php index d692be5..3327cc3 100644 --- a/core/modules/node/src/Tests/NodeTitleTest.php +++ b/core/modules/node/src/Tests/NodeTitleTest.php @@ -23,8 +23,12 @@ class NodeTitleTest extends NodeTestBase { protected $admin_user; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); $this->admin_user = $this->drupalCreateUser(array('administer nodes', 'create article content', 'create page content', 'post comments')); $this->drupalLogin($this->admin_user); diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php index 0109bf1..0c22bdc 100644 --- a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php +++ b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php @@ -72,6 +72,7 @@ function testPageCacheTags() { 'theme:bartik', 'theme_global_settings', 'block_view', + 'block:bartik_breadcrumbs', 'block:bartik_content', 'block:bartik_tools', 'block:bartik_login', @@ -79,6 +80,7 @@ function testPageCacheTags() { 'block:bartik_powered', 'block:bartik_main_menu', 'block:bartik_account_menu', + 'block_plugin:system_breadcrumb_block', 'block_plugin:system_main_block', 'block_plugin:system_menu_block__account', 'block_plugin:system_menu_block__main', @@ -102,6 +104,7 @@ function testPageCacheTags() { 'theme:bartik', 'theme_global_settings', 'block_view', + 'block:bartik_breadcrumbs', 'block:bartik_content', 'block:bartik_tools', 'block:bartik_login', @@ -110,6 +113,7 @@ function testPageCacheTags() { 'block:bartik_powered', 'block:bartik_main_menu', 'block:bartik_account_menu', + 'block_plugin:system_breadcrumb_block', 'block_plugin:system_main_block', 'block_plugin:system_menu_block__account', 'block_plugin:system_menu_block__main', diff --git a/core/modules/system/templates/page.html.twig b/core/modules/system/templates/page.html.twig index 88fc563..627d7c7 100644 --- a/core/modules/system/templates/page.html.twig +++ b/core/modules/system/templates/page.html.twig @@ -25,9 +25,6 @@ * - site_slogan: The slogan of the site. This is empty when displaying the site * slogan has been disabled in theme settings. * - * Navigation: - * - breadcrumb: The breadcrumb trail for the current page. - * * Page content (in order of occurrence in the default page.html.twig): * - title_prefix: Additional output populated by modules, intended to be * displayed in front of the main title tag that appears in the template. @@ -54,6 +51,7 @@ * - page.sidebar_first: Items for the first sidebar. * - page.sidebar_second: Items for the second sidebar. * - page.footer: Items for the footer region. + * - page.breadcrumb: Items for the breadcrumb region. * * @see template_preprocess_page() * @see html.html.twig @@ -96,7 +94,7 @@ {{ page.primary_menu }} {{ page.secondary_menu }} - {{ breadcrumb }} + {{ page.breadcrumb }} {{ messages }} diff --git a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php index 9a1436c..9c87e39 100644 --- a/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php +++ b/core/modules/taxonomy/src/Tests/TaxonomyTestBase.php @@ -24,8 +24,12 @@ */ public static $modules = array('taxonomy'); + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); // Create Basic page and Article node types. if ($this->profile != 'standard') { diff --git a/core/modules/user/src/Tests/Views/AccessTestBase.php b/core/modules/user/src/Tests/Views/AccessTestBase.php index 7777b13..31579bc 100644 --- a/core/modules/user/src/Tests/Views/AccessTestBase.php +++ b/core/modules/user/src/Tests/Views/AccessTestBase.php @@ -40,8 +40,12 @@ */ protected $normalRole; + /** + * {@inheritdoc} + */ protected function setUp() { parent::setUp(); + $this->drupalPlaceBlock('system_breadcrumb_block'); $this->enableViewsTestModule(); diff --git a/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml b/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml index c89b728..5589c10 100644 --- a/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml +++ b/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml @@ -1,9 +1,9 @@ id: bartik_breadcrumbs theme: bartik -weight: -5 -status: false +weight: 0 +status: true langcode: en -region: '-1' +region: breadcrumb plugin: system_breadcrumb_block settings: id: system_breadcrumb_block diff --git a/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml b/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml index 8ce13d8..fc95b02 100644 --- a/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml +++ b/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml @@ -1,9 +1,9 @@ id: seven_breadcrumbs theme: seven -weight: -2 -status: false +weight: 0 +status: true langcode: en -region: '-1' +region: breadcrumb plugin: system_breadcrumb_block settings: id: system_breadcrumb_block diff --git a/core/themes/bartik/bartik.info.yml b/core/themes/bartik/bartik.info.yml index cb1bcb1..dee3306 100644 --- a/core/themes/bartik/bartik.info.yml +++ b/core/themes/bartik/bartik.info.yml @@ -17,6 +17,7 @@ regions: page_top: 'Page top' page_bottom: 'Page bottom' highlighted: Highlighted + breadcrumb: Breadcrumb featured: Featured content: Content sidebar_first: 'Sidebar first' diff --git a/core/themes/bartik/templates/page.html.twig b/core/themes/bartik/templates/page.html.twig index 2b34b1a..1afb7bc 100644 --- a/core/themes/bartik/templates/page.html.twig +++ b/core/themes/bartik/templates/page.html.twig @@ -32,9 +32,6 @@ * on the theme settings page. If hidden, the "visually-hidden" class is * added to make the site slogan visually hidden, but still accessible. * - * Navigation: - * - breadcrumb: The breadcrumb trail for the current page. - * * Page content (in order of occurrence in the default page.html.twig): * - title_prefix: Additional output populated by modules, intended to be * displayed in front of the main title tag that appears in the template. @@ -69,6 +66,7 @@ * - page.footer_thirdcolumn: Items for the third footer column. * - page.footer_fourthcolumn: Items for the fourth footer column. * - page.footer: Items for the footer region. + * - page.breadcrumb: Items for the breadcrumb region. * * @see template_preprocess_page() * @see bartik_preprocess_page() @@ -130,7 +128,7 @@ {% endif %}
- {{ breadcrumb }} + {{ page.breadcrumb }}
{% if page.highlighted %}
{{ page.highlighted }}
{% endif %} diff --git a/core/themes/seven/seven.info.yml b/core/themes/seven/seven.info.yml index fdf916e..58cbe39 100644 --- a/core/themes/seven/seven.info.yml +++ b/core/themes/seven/seven.info.yml @@ -23,5 +23,6 @@ regions: page_top: 'Page top' page_bottom: 'Page bottom' sidebar_first: 'First sidebar' + breadcrumb: breadcrumb regions_hidden: - sidebar_first diff --git a/core/themes/seven/templates/page.html.twig b/core/themes/seven/templates/page.html.twig index b2cc0bf..fc3c7d4 100644 --- a/core/themes/seven/templates/page.html.twig +++ b/core/themes/seven/templates/page.html.twig @@ -26,9 +26,6 @@ * - site_slogan: The slogan of the site. This is empty when displaying the site * slogan has been disabled in theme settings. * - * Navigation: - * - breadcrumb: The breadcrumb trail for the current page. - * * Page content (in order of occurrence in the default page.html.twig): * - title_prefix: Additional output populated by modules, intended to be * displayed in front of the main title tag that appears in the template. @@ -53,6 +50,7 @@ * - page.sidebar_first: Items for the first sidebar. * - page.sidebar_second: Items for the second sidebar. * - page.page_bottom: Items for the footer region. + * - page.breadcrumb: Items for the breadcrumb region. * * @see template_preprocess_page() * @see seven_preprocess_page() @@ -77,7 +75,7 @@ {% endif %} - {{ breadcrumb }} + {{ page.breadcrumb }}