Issue #3079595 by jhodgdon: The Help breadcrumb builder does not set cache contexts
parent
6a2d67db47
commit
00d8dafd76
|
@ -43,6 +43,7 @@ class HelpBreadcrumbBuilder implements BreadcrumbBuilderInterface {
|
|||
*/
|
||||
public function build(RouteMatchInterface $route_match) {
|
||||
$breadcrumb = new Breadcrumb();
|
||||
$breadcrumb->addCacheContexts(['url.path.parent']);
|
||||
$breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '<front>'));
|
||||
$breadcrumb->addLink(Link::createFromRoute($this->t('Administration'), 'system.admin'));
|
||||
$breadcrumb->addLink(Link::createFromRoute($this->t('Help'), 'help.main'));
|
||||
|
|
|
@ -66,6 +66,7 @@ class HelpTopicTest extends BrowserTestBase {
|
|||
'access administration pages',
|
||||
'view the administration theme',
|
||||
'administer permissions',
|
||||
'administer site configuration',
|
||||
]);
|
||||
$this->anyUser = $this->createUser([]);
|
||||
}
|
||||
|
@ -235,12 +236,21 @@ class HelpTopicTest extends BrowserTestBase {
|
|||
// Verify Help Topics administration breadcrumbs.
|
||||
$trail = [
|
||||
'' => 'Home',
|
||||
'admin' => t('Administration'),
|
||||
'admin/help' => t('Help'),
|
||||
'admin' => 'Administration',
|
||||
'admin/help' => 'Help',
|
||||
];
|
||||
$this->assertBreadcrumb('admin/help/topic/help_topics_test.test', $trail);
|
||||
// Ensure we are on the expected help topic page.
|
||||
$this->assertSession()->pageTextContains('Also there should be a related topic link below to the Help module topic page and the linked topic.');
|
||||
|
||||
// Verify that another page does not have the help breadcrumb.
|
||||
$trail = [
|
||||
'' => 'Home',
|
||||
'admin' => 'Administration',
|
||||
'admin/config' => 'Configuration',
|
||||
'admin/config/system' => 'System',
|
||||
];
|
||||
$this->assertBreadcrumb('admin/config/system/site-information', $trail);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue