From fd96e6a4d202acdb6985a1e3b17576f5f65c06e6 Mon Sep 17 00:00:00 2001 From: Ryan Schultz Date: Sat, 30 May 2026 16:28:14 -0500 Subject: [PATCH] Fix #8128: Fix filter_elements skipping groups after a zero-result facet_list When a `+`-separated filter group returns no results, `FacetTransformer.facet_list` was skipping the reset of `has_additive_facet_in_current_list` because the reset was inside the `if self.elements:` guard. The stale flag caused the next group's `add_default_elements()` to bail out early, leaving its element set empty and silently dropping every subsequent group from the result. Move the flag reset outside the guard so it always fires regardless of whether the group produced any results. --- src/ifcopenshell-python/ifcopenshell/util/selector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/selector.py b/src/ifcopenshell-python/ifcopenshell/util/selector.py index bbe8125927..abaa4e4119 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/selector.py +++ b/src/ifcopenshell-python/ifcopenshell/util/selector.py @@ -916,7 +916,7 @@ class FacetTransformer(lark.Transformer): if self.elements: self.results.append(self.elements) self.elements = set() - self.has_additive_facet_in_current_list = False + self.has_additive_facet_in_current_list = False def instance(self, args): self.has_additive_facet_in_current_list = True