Skip to content

Commit 29e86c4

Browse files
authored
Metastore Search - check for empty facet from content (#4712)
1 parent 16397fd commit 29e86c4

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

modules/dkan_metastore/modules/dkan_metastore_search/src/FacetsFromContentTrait.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,13 @@ private function getAllFacetsWithZeroCounts(array $facetsTypes) {
130130

131131
$facet = isset($field) ? $facet->{"$.data." . $field} : $facet->{"$.data"};
132132

133-
$facets["{$type}:{$facet}"] = (object) [
134-
'type' => $type,
135-
'name' => $facet,
136-
'total' => 0,
137-
];
133+
if (!empty($facet)) {
134+
$facets["{$type}:{$facet}"] = (object) [
135+
'type' => $type,
136+
'name' => $facet,
137+
'total' => 0,
138+
];
139+
}
138140
}
139141
}
140142

0 commit comments

Comments
 (0)