The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit af50a07c authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Avoid querying e.g. home page facets from the backend if none are enabled. (#925)

parent 6862422c
No related merge requests found
......@@ -581,11 +581,17 @@ class SearchController extends AbstractSearch
$params = $results->getParams();
$params->$initMethod();
// We only care about facet lists, so don't get any results (this helps
// prevent problems with serialized File_MARC objects in the cache):
$params->setLimit(0);
$list = $results->getFacetList();
// Avoid a backend request if there are no facets configured by the given
// init method.
if (!empty($params->getFacetConfig())) {
// We only care about facet lists, so don't get any results (this
// helps prevent problems with serialized File_MARC objects in the
// cache):
$params->setLimit(0);
$list = $results->getFacetList();
} else {
$list = [];
}
$cache->setItem($cacheName, $list);
}
......
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