summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslasher132017-03-17 21:32:38 (GMT)
committerJoris Vercammen2017-03-17 21:32:38 (GMT)
commit5dc5052a0fffbdea2bf61af59ea9c46be54ad342 (patch)
treee56c3165ae32c99f3345cba8eabdcda68258204a
parentce0fbe55a1ab014a20202942718739fa9ba50c82 (diff)
Issue #2859139 by borisson_, marcvangend, slasher13: Automatically disable caching of views facet sources (regression)8.x-1.0-alpha8
-rw-r--r--modules/facets_summary/src/Form/FacetsSummarySettingsForm.php6
-rw-r--r--src/Form/FacetSettingsForm.php3
2 files changed, 5 insertions, 4 deletions
diff --git a/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php b/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php
index 5cc1934..ff3c9ba 100644
--- a/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php
+++ b/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php
@@ -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'];
diff --git a/src/Form/FacetSettingsForm.php b/src/Form/FacetSettingsForm.php
index 1c8372b..c52234d 100644
--- a/src/Form/FacetSettingsForm.php
+++ b/src/Form/FacetSettingsForm.php
@@ -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;
}