Skip to content

Commit

Permalink
Issue #2969756 by maurizio.ganovelli: Facet must take in account only…
Browse files Browse the repository at this point in the history
… unit type bundles configured for datasource
  • Loading branch information
Nicolò Caruso committed May 5, 2018
1 parent 176c929 commit 134643e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules/bat_facets/bat_facets.module
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ function bat_facets_search_api_query_alter(QueryInterface &$query) {

$valid_type_ids = [];

// We need to narrow the query to all Types with Units that have the
// requested state over the requested dates.
// We need to narrow the query to all unit types configured for this datasource
// with Units that have the requested state over the requested dates.
// First, we retrieve all types.
$type_ids = bat_type_ids();
$type_ids = [];
foreach (array_keys($datasource->getBundles()) as $bundle) {
$type_ids += bat_type_ids($bundle);
}

foreach ($type_ids as $type_id => $name) {
// Get the units of this type.
Expand Down

0 comments on commit 134643e

Please sign in to comment.