Commit 5dc5052a authored by slasher13's avatar slasher13 Committed by borisson_

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

Issue #2859139 by borisson_, marcvangend, slasher13: Automatically disable caching of views facet sources (regression)
parent ce0fbe55
......@@ -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;
}
......
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