diff --git a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php index 1802a4569c3f42b70ad881028c1bf636a5a96020..f0ac482d381d8594c58efb63b9c8bc599e4ae26f 100644 --- a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php +++ b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php @@ -194,11 +194,7 @@ protected function nodeTitleList(array $nids, $title) { $items = []; foreach ($nids as $nid) { $node = $this->entityRepository->getTranslationFromContext($nodes[$nid]); - $item = [ - '#type' => 'link', - '#title' => $node->getTitle(), - '#url' => $node->urlInfo('canonical'), - ]; + $item = $node->toLink()->toRenderable(); $this->renderer->addCacheableDependency($item, $node); $items[] = $item; }