diff --git a/core/modules/help_topics/src/Controller/HelpTopicPluginController.php b/core/modules/help_topics/src/Controller/HelpTopicPluginController.php index ecf2196ce5..5cdd79473c 100644 --- a/core/modules/help_topics/src/Controller/HelpTopicPluginController.php +++ b/core/modules/help_topics/src/Controller/HelpTopicPluginController.php @@ -80,25 +80,23 @@ public function viewHelpTopic($id) { $related = $help_topic->getRelated(); foreach ($related as $other_id) { - if ($other_id !== $help_topic->getPluginId()) { + if ($other_id !== $id) { if (!$this->helpTopicPluginManager->hasDefinition($other_id)) { - continue; + break; } /** @var \Drupal\help_topics\Plugin\HelpTopic\HelpTopicPluginInterface $topic */ $topic = $this->helpTopicPluginManager->createInstance($other_id); - if ($topic) { - $links[$other_id] = [ - 'title' => $topic->getLabel(), - 'url' => Url::fromRoute('help_topics.help_topic', ['id' => $other_id]), - ]; - $this->renderer->addCacheableDependency($build, $topic); - } + $links[$other_id] = [ + 'title' => $topic->getLabel(), + 'url' => Url::fromRoute('help_topics.help_topic', ['id' => $other_id]), + ]; + $this->renderer->addCacheableDependency($build, $topic); } } // Add in any plugins that have said "List me on this topic". - $liston = $this->helpTopicPluginManager->getAllListOn($id); - foreach ($liston as $topic) { + $list_on = $this->helpTopicPluginManager->getAllListOn($id); + foreach ($list_on as $topic) { $other_id = $topic->getPluginId(); $links[$other_id] = [ 'title' => $topic->getLabel(), @@ -115,7 +113,7 @@ public function viewHelpTopic($id) { return ($a['title'] < $b['title']) ? -1 : 1; }); $build['#related'] = [ - '#theme' => 'links', + '#theme' => 'links__related', '#heading' => [ 'text' => $this->t('Related topics'), 'level' => 'h2', diff --git a/core/modules/help_topics/src/HelpBreadcrumbBuilder.php b/core/modules/help_topics/src/HelpBreadcrumbBuilder.php index 586be5303a..e1157c4b97 100644 --- a/core/modules/help_topics/src/HelpBreadcrumbBuilder.php +++ b/core/modules/help_topics/src/HelpBreadcrumbBuilder.php @@ -41,7 +41,6 @@ public function build(RouteMatchInterface $route_match) { $breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '')); $breadcrumb->addLink(Link::createFromRoute($this->t('Administration'), 'system.admin')); $breadcrumb->addLink(Link::createFromRoute($this->t('Help'), 'help.main')); - $breadcrumb->addCacheContexts(['route.name']); return $breadcrumb; }