Commit d98306cf authored by mollux's avatar mollux Committed by borisson_
Browse files

Issue #2588799 by mollux: Making a facet work depends on the view; it’s...

Issue #2588799 by mollux: Making a facet work depends on the view; it’s cacheability should be disabled
parent ca470869
......@@ -17,6 +17,7 @@ use Drupal\facetapi\FacetSource\FacetSourcePluginManager;
use Drupal\facetapi\Processor\ProcessorInterface;
use Drupal\facetapi\Processor\ProcessorPluginManager;
use Drupal\facetapi\Widget\WidgetPluginManager;
use Drupal\views\Views;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -413,6 +414,16 @@ class FacetForm extends EntityForm {
$facet->setFieldIdentifier($field_identifier);
$facet->save();
// Ensure that the caching of the view display is disabled, so the search
// correctly returns the facets. This is a temporary fix, until the cache
// metadata is correctly stored on the facet block.
list(, $view_id, $display) = explode(':', $facet_source);
$view = Views::getView($view_id);
$display = &$view->storage->getDisplay($display);
$display['display_options']['cache']['type'] = 'none';
$view->storage->save();
return $facet;
}
......
Supports Markdown
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