diff --git a/core/modules/block_content/block_content.routing.yml b/core/modules/block_content/block_content.routing.yml index 3f826d61d5412073acb2bb7af2cafa12af67eaa7..47bb0577b415aef2ff169292eb9be4690c9e3bbd 100644 --- a/core/modules/block_content/block_content.routing.yml +++ b/core/modules/block_content/block_content.routing.yml @@ -22,6 +22,7 @@ entity.block_content.canonical: path: '/block/{block_content}' defaults: _entity_form: 'block_content.edit' + _title_callback: '\Drupal\Core\Entity\Controller\EntityController::title' options: _admin_route: TRUE requirements: diff --git a/core/modules/block_content/tests/src/Functional/PageEditTest.php b/core/modules/block_content/tests/src/Functional/PageEditTest.php index e310cb1a7d93b6019283674a6cc5a776f817e52e..38beb80b93920d81095a7a89035cd365513c6fe0 100644 --- a/core/modules/block_content/tests/src/Functional/PageEditTest.php +++ b/core/modules/block_content/tests/src/Functional/PageEditTest.php @@ -3,6 +3,7 @@ namespace Drupal\Tests\block_content\Functional; use Drupal\block_content\Entity\BlockContent; +use Drupal\Tests\system\Functional\Menu\AssertBreadcrumbTrait; /** * Create a block and test block edit functionality. @@ -11,6 +12,8 @@ */ class PageEditTest extends BlockContentTestBase { + use AssertBreadcrumbTrait; + /** * {@inheritdoc} */ @@ -23,6 +26,7 @@ protected function setUp(): void { parent::setUp(); $this->drupalPlaceBlock('page_title_block'); + $this->drupalPlaceBlock('system_breadcrumb_block'); } /** @@ -77,6 +81,15 @@ public function testPageEdit() { $this->drupalGet("block/" . $revised_block->id()); $this->clickLink('Delete'); $this->assertSession()->pageTextContains('Are you sure you want to delete the custom block ' . $revised_block->label() . '?'); + + // Test breadcrumb. + $trail = [ + '' => 'Home', + 'block/' . $revised_block->id() => $revised_block->label(), + ]; + $this->assertBreadcrumb( + 'block/' . $revised_block->id() . '/delete', $trail + ); } } diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index e7c54ba7afda0e66da531b0903e663e751eb7034..1e5797ced031581ca5d656ae7d9304527f2a028e 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -2175,6 +2175,11 @@ parameters: count: 2 path: modules/system/tests/modules/entity_test/entity_test.install + - + message: "#^Variable \\$goto in isset\\(\\) always exists and is not nullable\\.$#" + count: 1 + path: modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php + - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 1