Skip to content
Snippets Groups Projects
Commit 5dc5052a authored by Maik H.'s avatar Maik H. Committed by Joris Vercammen
Browse files

Issue #2859139 by borisson_, marcvangend, slasher13: Automatically disable...

Issue #2859139 by borisson_, marcvangend, slasher13: Automatically disable caching of views facet sources (regression)
parent ce0fbe55
No related branches found
Tags 8.x-1.0-alpha8
No related merge requests found
......@@ -242,15 +242,15 @@ class FacetsSummarySettingsForm extends EntityForm {
// Clear Drupal cache for blocks to reflect recent changes.
$this->blockManager->clearCachedDefinitions();
if (!\Drupal::moduleHandler()->moduleExists('search_api')) {
$facet_source_id = $form_state->getValue('facet_source_id');
list($type,) = explode(':', $facet_source_id);
if ($type !== 'search_api') {
return $facets_summary;
}
// Ensure that the caching of the view display is disabled, so the search
// correctly returns the facets. First, get the plugin definition of the
// Search API display.
$facet_source_id = $form_state->getValue('facet_source_id');
$facet_source = $this->facetSourcePluginManager->createInstance($facet_source_id, ['facet' => $this->getEntity()]);
if (isset($facet_source) && $facet_source instanceof FacetSourcePluginInterface) {
$facet_source_display_id = $facet_source->getPluginDefinition()['display_id'];
......
......@@ -326,7 +326,8 @@ class FacetSettingsForm extends EntityForm {
// Clear Drupal cache for blocks to reflect recent changes.
$this->blockManager->clearCachedDefinitions();
if (!\Drupal::moduleHandler()->moduleExists('search_api')) {
list($type,) = explode(':', $facet_source_id);
if ($type !== 'search_api') {
return $facet;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment