# Strange filter behavior in 6.0.1

**URL:** <https://gramps.discourse.group/t/strange-filter-behavior-in-6-0-1/7505>\
**Category:** Help\
**Tags:** bug-filed, custom-filters\
**Created:** [April 22, 2025, 10:30pm UTC](https://gramps.discourse.group/t/strange-filter-behavior-in-6-0-1/7505 "2025-04-22T22:30:56Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![kku](https://avatars.discourse-cdn.com/v4/letter/k/6bbea6/32.png) [@kku](https://gramps.discourse.group/u/kku)\
**Post date:** [April 24, 2025, 10:52am UTC](https://gramps.discourse.group/t/strange-filter-behavior-in-6-0-1/7505/8 "2025-04-24T10:52:22Z")

</div>

I investigated this a bit.

It seems that there might be an issue with the new Optimizer class in Gramps 6.0.

Not sure why but this workaround seems to help: add a line in the method `apply_logical_op_to_all` in the file `gramps/gen/filters/_genericfilter.py` ([around line 149](https://github.com/gramps-project/gramps/blob/827b2018d01bb166ae3efe8bdfdb4f0070957605/gramps/gen/filters/_genericfilter.py#L147-L148)) as follows:

```
    optimizer = Optimizer(self)
    handles_in, handles_out = optimizer.get_handles()
    if not handles_in: handles_in = None # add this line

```

---

_[View the full topic](https://gramps.discourse.group/t/strange-filter-behavior-in-6-0-1/7505)._
