Commit 583eaef6 authored by StryKaizer's avatar StryKaizer Committed by StryKaizer
Browse files

Issue #2913082 by StryKaizer: Do not build facets for every request

parent 59de7895
......@@ -78,6 +78,11 @@ class FacetBlock extends BlockBase implements ContainerFactoryPluginInterface {
/** @var \Drupal\facets\FacetInterface $facet */
$facet = $this->facetStorage->load($facet_id);
// No need to build the facet if it does not need to be visible.
if($facet->getOnlyVisibleWhenFacetSourceIsVisible() && !$facet->getFacetSource()->isRenderedInCurrentRequest()){
// Let the facet_manager build the facets.
$build = $this->facetManager->build($facet);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment