Error message when I use filters in 6.0.6

When I try to filter by name in Gramps, I get an error message.

145287: ERROR: grampsapp.py: line 187: Unhandled exception
Traceback (most recent call last):
File “C:\\Program Files\\GrampsAIO64-6.0.6\\gramps\\gui\\filters\\sidebar_sidebarfilter.py”, line 210, in key_press
self.clicked(obj)
File “C:\\Program Files\\GrampsAIO64-6.0.6\\gramps\\gui\\filters\\sidebar_sidebarfilter.py”, line 165, in clicked
self.clicked_func()
File “C:\\Program Files\\GrampsAIO64-6.0.6\\gramps\\plugins\\gramplet\\filter.py”, line 77, in \__filter_clicked
self.gui.view.build_tree()
File “C:\\Program Files\\GrampsAIO64-6.0.6\\gramps\\gui\\views\\listview.py”, line 363, in build_tree
self.model.rebuild_data()
File “C:\\Program Files\\GrampsAIO64-6.0.6\\gramps\\gui\\views\\treemodels\\flatbasemodel.py”, line 629, in \_rebuild_filter
dlist = self.search.apply(cdb, allkeys, tupleind=1, user=self.user)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\\Program Files\\GrampsAIO64-6.0.6\\gramps\\gen\\filters_genericfilter.py”, line 315, in apply
res = self.apply_logical_op_to_all(db, possible_handles, apply_logical_op, user)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “filterprogress.gpr.py”, line 192, in new_apply_logical_op_to_all
TypeError: Optimizer.**init**() missing 1 required positional argument: ‘top_level_filter’

When I try to filter by name in Gramps, I get an error message. I don’t know what I did wrong. Perhaps someone has a solution before I reinstall everything.

Gramps 6.0.6 is running on Windows 11.

Re-installing is rarely a solution to exceptions thrown while running Gramps.

In this case, the call stack indicates you’re using filterprogress addon and I am not sure where that comes from. I can’t find it in Gramps addons. It’s possible it needs to be updated to match Gramps’ Optimizer class.

Please a open a bug report so it can be investigated. Thanks.

2 Likes

The Cancel button in the Filter progress dialog had a recent improvement. Formerly, canceling always failed with a warning that the current process was too important to interrupt. Now it actually interrupts when asked.

@kku did work to make the filtering cancel with both the Filter+ gramplets (which were rolled in the 6.0 core) and Filter Params addons.

And @dsblank said that the Cancel feature should be targeted when he was alerted that it wasn’t functional during the Filtering rewrite development.

So we should get their opinions.

But… I think that the most likely issue may be in a keybinding keystrokes being passed and acted upon before everything was ready.

There are other examples of this happening: when creating a new Child in a family where:

  1. the given name data has been keyed in but the field is still active (so the field data has not been parsed)
  2. the gender is unknown and waiting for the gender guessing (based on the statistics of the given name)
  3. the commit keybinding is sent
  4. the gender validation of a new person creation is needed.

In this situation, an error is generated and new person, although created, is not attached to the Family.

I think this may be similar.

Perhaps the Name filtering field has data entered but the field is still active. But a keybinding was used to start the filter. And the keybinding was also passed to the Cancel button of the Filter Progress dialog. So it tried to cancel the filter before it had initialized everything.

2 Likes

@Woody , looks like just a bug.

That will appear in Gramps 6.1.

2 Likes

FilterProgress is an extension written by me that adds the Cancel button to the progress dialog. See gramps/addons/filterprogress at master · kkujansuu/gramps · GitHub

But obviously the internal Optimizer class has changed in 6.0.6 so that FilterProgress does not work anymore. Please remove the extension. Maybe I can also fix this at some point.

2 Likes

This begs the question… can .gpr.py registrations limit installation at the maintenance release version level?

As in, can 6.0.6 be excluded from the FilterProgress compatibility/install list?

Or should a 6.0.7 optimizer eliminate the incompatibility?

1 Like

No, as far as I understand gramps_target_version = "6.0.6” would mean that the plugin requires at least the version 6.0.6 (i.e. any version 6.0.x where x is 6 or larger). So it is only possible to exclude versions from 6.0.0 to some 6.0.x.

Of course, it is possible to programmatically exclude any version in the plugin code itself.

2 Likes

Thank you all so much!

It was indeed due to the new version of Kari’s @kku “gramps-master” edition.

The error doesn’t occur with the old version.

I had forgotten that I had installed the “gramps-master” update, as I’ve been working on my Excel files for import into Gramps for weeks.

There is now a new version of FilterProgress at gramps/addons/filterprogress at master · kkujansuu/gramps · GitHub which should fix this for Gramps 6.0.4 and later.

4 Likes

Great job, Kari, it’s working again.

Thank you so much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.