diff --git a/core/modules/forum/src/Controller/ForumController.php b/core/modules/forum/src/Controller/ForumController.php index b3ae8a0..7a17292 100644 --- a/core/modules/forum/src/Controller/ForumController.php +++ b/core/modules/forum/src/Controller/ForumController.php @@ -93,8 +93,10 @@ class ForumController extends ControllerBase { * Node type storage handler. * @param \Drupal\Core\Render\RendererInterface $renderer * The renderer. + * @param array $node_list_cache_tags + * Array of node list cache tags. */ - public function __construct(ForumManagerInterface $forum_manager, VocabularyStorageInterface $vocabulary_storage, TermStorageInterface $term_storage, AccountInterface $current_user, EntityAccessControlHandlerInterface $node_access, array $field_map, EntityStorageInterface $node_type_storage, RendererInterface $renderer) { + public function __construct(ForumManagerInterface $forum_manager, VocabularyStorageInterface $vocabulary_storage, TermStorageInterface $term_storage, AccountInterface $current_user, EntityAccessControlHandlerInterface $node_access, array $field_map, EntityStorageInterface $node_type_storage, RendererInterface $renderer, array $node_list_cache_tags) { $this->forumManager = $forum_manager; $this->vocabularyStorage = $vocabulary_storage; $this->termStorage = $term_storage; @@ -103,6 +105,7 @@ public function __construct(ForumManagerInterface $forum_manager, VocabularyStor $this->fieldMap = $field_map; $this->nodeTypeStorage = $node_type_storage; $this->renderer = $renderer; + $this->nodeListCacheTags = $node_list_cache_tags; } /** @@ -119,7 +122,8 @@ public static function create(ContainerInterface $container) { $entity_manager->getAccessControlHandler('node'), $entity_manager->getFieldMap(), $entity_manager->getStorage('node_type'), - $container->get('renderer') + $container->get('renderer'), + $entity_manager->getDefinition('node')->getListCacheTags() ); } @@ -209,7 +213,7 @@ protected function build($forums, TermInterface $term, $topics = array(), $paren 'action' => $this->buildActionLinks($config->get('vocabulary'), $term), 'forum' => $build, '#cache' => [ - 'tags' => \Drupal::entityManager()->getDefinition('node')->getListCacheTags(), + 'tags' => $this->nodeListCacheTags, ], ]; }