Commit 586b7ecd authored by axel.rutz's avatar axel.rutz Committed by borisson_

Issue #3025534 by axel.rutz: Initially empty dropdown facet not dropdownified

parent 6a050417
......@@ -313,6 +313,11 @@ class DefaultFacetManager {
$facet->setResults($results);
// We include this build even if empty, it may contain attached libraries.
/** @var \Drupal\facets\Widget\WidgetPluginInterface $widget */
$widget = $facet->getWidgetInstance();
$build = $widget->build($facet);
// No results behavior handling. Return a custom text or false depending on
// settings.
if (empty($facet->getResults())) {
......@@ -320,6 +325,7 @@ class DefaultFacetManager {
if ($empty_behavior['behavior'] == 'text') {
return [
[
$build,
'#type' => 'container',
'#attributes' => [
'data-drupal-facet-id' => $facet->id(),
......@@ -340,6 +346,7 @@ class DefaultFacetManager {
// content.
return [
[
$build,
'#type' => 'container',
'#attributes' => [
'data-drupal-facet-id' => $facet->id(),
......@@ -350,10 +357,7 @@ class DefaultFacetManager {
}
}
/** @var \Drupal\facets\Widget\WidgetPluginInterface $widget */
$widget = $facet->getWidgetInstance();
return [$widget->build($facet)];
return [$build];
}
/**
......
Markdown is supported
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