diff --git a/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php b/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php
index 1a94073..5cc1934 100644
--- a/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php
+++ b/modules/facets_summary/src/Form/FacetsSummarySettingsForm.php
@@ -206,31 +206,6 @@ class FacetsSummarySettingsForm extends EntityForm {
     $is_new = $facets_summary->isNew();
     $facets_summary->save();
 
-    // 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'];
-      $search_api_display = \Drupal::service('plugin.manager.search_api.display')
-        ->createInstance($facet_source_display_id);
-      $search_api_display_definition = $search_api_display->getPluginDefinition();
-
-      // Get the view of the Search API display and disable caching.
-      if (!empty($search_api_display_definition['view_id'])) {
-        $view_id = $search_api_display_definition['view_id'];
-        $view_display = $search_api_display_definition['view_display'];
-
-        $view = Views::getView($view_id);
-        $view->setDisplay($view_display);
-        $view->display_handler->overrideOption('cache', ['type' => 'none']);
-        $view->save();
-
-        drupal_set_message($this->t('Caching of view %view has been disabled.', ['%view' => $view->storage->label()]));
-      }
-    }
-
     if ($is_new) {
       if ($this->moduleHandler->moduleExists('block')) {
         $message = $this->t('Facet Summary %name has been created. Go to the <a href=":block_overview">Block overview page</a> to place the new block in the desired region.', ['%name' => $facets_summary->getName(), ':block_overview' => $this->urlGenerator->generateFromRoute('block.admin_display')]);
@@ -268,6 +243,35 @@ class FacetsSummarySettingsForm extends EntityForm {
     // Clear Drupal cache for blocks to reflect recent changes.
     $this->blockManager->clearCachedDefinitions();
 
+    if (!\Drupal::moduleHandler()->moduleExists('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'];
+      $search_api_display = \Drupal::service('plugin.manager.search_api.display')
+        ->createInstance($facet_source_display_id);
+      $search_api_display_definition = $search_api_display->getPluginDefinition();
+
+      // Get the view of the Search API display and disable caching.
+      if (!empty($search_api_display_definition['view_id'])) {
+        $view_id = $search_api_display_definition['view_id'];
+        $view_display = $search_api_display_definition['view_display'];
+
+        $view = Views::getView($view_id);
+        $view->setDisplay($view_display);
+        $view->display_handler->overrideOption('cache', ['type' => 'none']);
+        $view->save();
+
+        drupal_set_message($this->t('Caching of view %view has been disabled.', ['%view' => $view->storage->label()]));
+      }
+    }
+
     return $facets_summary;
   }
 
diff --git a/src/Form/FacetSettingsForm.php b/src/Form/FacetSettingsForm.php
index a73bd56..1c8372b 100644
--- a/src/Form/FacetSettingsForm.php
+++ b/src/Form/FacetSettingsForm.php
@@ -308,6 +308,28 @@ class FacetSettingsForm extends EntityForm {
     }
     $facet->save();
 
+    if ($is_new) {
+      if ($this->moduleHandler->moduleExists('block')) {
+        $message = $this->t('Facet %name has been created. Go to the <a href=":block_overview">Block overview page</a> to place the new block in the desired region.', ['%name' => $facet->getName(), ':block_overview' => $this->urlGenerator->generateFromRoute('block.admin_display')]);
+        drupal_set_message($message);
+        $form_state->setRedirect('entity.facets_facet.edit_form', ['facets_facet' => $facet->id()]);
+      }
+
+      if (isset($view_id, $display_plugin) && $display_plugin === 'block') {
+        $facet->setOnlyVisibleWhenFacetSourceIsVisible(FALSE);
+      }
+    }
+    else {
+      drupal_set_message($this->t('Facet %name has been updated.', ['%name' => $facet->getName()]));
+    }
+
+    // Clear Drupal cache for blocks to reflect recent changes.
+    $this->blockManager->clearCachedDefinitions();
+
+    if (!\Drupal::moduleHandler()->moduleExists('search_api')) {
+      return $facet;
+    }
+
     // 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.
@@ -328,29 +350,9 @@ class FacetSettingsForm extends EntityForm {
         $view->save();
 
         drupal_set_message($this->t('Caching of view %view has been disabled.', ['%view' => $view->storage->label()]));
-
-        $display_plugin = $view->getDisplay()->getPluginId();
       }
     }
 
-    if ($is_new) {
-      if ($this->moduleHandler->moduleExists('block')) {
-        $message = $this->t('Facet %name has been created. Go to the <a href=":block_overview">Block overview page</a> to place the new block in the desired region.', ['%name' => $facet->getName(), ':block_overview' => $this->urlGenerator->generateFromRoute('block.admin_display')]);
-        drupal_set_message($message);
-        $form_state->setRedirect('entity.facets_facet.edit_form', ['facets_facet' => $facet->id()]);
-      }
-
-      if (isset($view_id, $display_plugin) && $display_plugin === 'block') {
-        $facet->setOnlyVisibleWhenFacetSourceIsVisible(FALSE);
-      }
-    }
-    else {
-      drupal_set_message($this->t('Facet %name has been updated.', ['%name' => $facet->getName()]));
-    }
-
-    // Clear Drupal cache for blocks to reflect recent changes.
-    $this->blockManager->clearCachedDefinitions();
-
     return $facet;
   }
 
