From 217db8fca80b1b83c00b61177423c06eb4bbd572 Mon Sep 17 00:00:00 2001 From: Malcolm Young <malcolm.young@capgemini.com> Date: Thu, 3 Apr 2025 05:17:45 +0100 Subject: [PATCH] Issue #3517059: Error when accessing search results page if index is disabled --- search_api.module | 3 +++ 1 file changed, 3 insertions(+) diff --git a/search_api.module b/search_api.module index 1bdae9d2..88293708 100644 --- a/search_api.module +++ b/search_api.module @@ -600,6 +600,9 @@ function search_api_form_views_exposed_form_alter(&$form, FormStateInterface $fo // not always actually saved in the storage, if the admin didn't change // their settings.) $query = $query_plugin->getSearchApiQuery(); + if (empty($query)) { + return; + } $display_id = $query->getSearchId(FALSE); $facet_source_id = str_replace(':', '__', 'search_api:' . $display_id); $facet_source = \Drupal::entityTypeManager() -- GitLab