diff --git a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php index e9f9dc4..09b3662 100644 --- a/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php +++ b/core/modules/views/src/Plugin/Block/ViewsExposedFilterBlock.php @@ -29,9 +29,12 @@ public function build() { $this->addContextualLinks($output, 'exposed_filter'); // Merge cache contexts for each filter option. + if (!isset($output['#cache']['contexts'])) { + $output['#cache']['contexts'] = []; + } $contexts = &$output['#cache']['contexts']; foreach ($this->view->filter as $id => $handler) { - if ($handler->canExpose() && $handler->isExposed() && !empty($handler->options['expose']['identifier'])) { + if ($handler->canExpose() && $handler->isExposed()) { $contexts = Cache::mergeContexts($contexts, $handler->getCacheContexts()); } }