diff --git a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php index e255ede..8148565 100644 --- a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php @@ -20,11 +20,18 @@ class ViewsExposedFilterBlock extends ViewsBlockBase { /** + * @inheritedDoc + */ + public function getCacheContexts() { + $contexts = $this->view->display_handler->getCacheMetadata()->getCacheContexts(); + return Cache::mergeContexts(parent::getCacheContexts(), $contexts); + } + + /** * {@inheritdoc} */ public function build() { $output = $this->view->display_handler->viewExposedFormBlocks(); - $output['#cache']['contexts'] = $this->view->display_handler->getCacheMetadata()->getCacheContexts(); // Before returning the block output, convert it to a renderable array with // contextual links.