summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2018-02-18 16:17:42 (GMT)
committerNathaniel Catchpole2018-02-19 12:10:48 (GMT)
commit84e302e00c080033dadd25a15d13506346065293 (patch)
tree64ac08a5843af8af90c613ec27560f12386584bf
parentf5f0896031a6f8e59eef756283721b91b3e0a123 (diff)
Issue #2778167 by Wim Leers, arunkumark: Build link in Statistics block with toRenderable()
(cherry picked from commit e89abeb2527f25bd12f3b503671e8c08c1c1a616)
-rw-r--r--core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php6
1 files changed, 1 insertions, 5 deletions
diff --git a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
index 1802a45..f0ac482 100644
--- a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
+++ b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
@@ -194,11 +194,7 @@ class StatisticsPopularBlock extends BlockBase implements ContainerFactoryPlugin
$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;
}