Skip to content
Snippets Groups Projects

When no results are available, we do not need to sort the facet or render the form item.

Open Matthias Muller requested to merge issue/facets-3503793:3503793-facet-title-does into 3.0.x
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
@@ -135,8 +135,8 @@ class FacetsFilter extends FilterPluginBase {
$query_type_plugin->build();
// When no results are available, we do not need to process the facet or render the form item.
if(!$facet->getResults()) {
return;
if (!$facet->getResults()) {
return $form;
}
// Trigger post query stage.
@@ -151,6 +151,11 @@ class FacetsFilter extends FilterPluginBase {
$facet->setResults($processor->build($facet, $facet->getResults()));
}
// When no results are available, we do not need to sort the facet or render the form item.
if (!$facet->getResults()) {
return $form;
}
// Trigger sort stage and sort the actual results with the sort processors.
$active_sort_processors = [];
foreach ($facet->getProcessorsByStage(ProcessorInterface::STAGE_SORT) as $processor) {
Loading