Restoring 5.1 filters into 5.2

I have moved to 5.2.
I copied custom_filters.xml from gramps51 to gramp52: this has several hundred lines of my filters. I got the error below when I restarted gramps. Please, is there a way I can restore my 5.1 filters into 5.2?

 1680: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\grampsgui.py", line 768, in do_activate
    Gramps(self.argparser, self)
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\grampsgui.py", line 574, in __init__
    self._vm = ViewManager(app, dbstate, config.get("interface.view-categories"))
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\viewmanager.py", line 237, in __init__
    reload_custom_filters()
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gen\filters\__init__.py", line 42, in reload_custom_filters
    CustomFilters.load()
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gen\filters\_filterlist.py", line 112, in load
    parser.parse(the_file)
  File "AIO/xml/sax/expatreader.py", line 111, in parse
  File "AIO/xml/sax/xmlreader.py", line 125, in parse
  File "AIO/xml/sax/expatreader.py", line 217, in feed
  File "C:/M/B/src/Python-3.11.8/Modules/pyexpat.c", line 468, in EndElement
  File "AIO/xml/sax/expatreader.py", line 336, in end_element
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gen\filters\_filterparser.py", line 149, in endElement
    rule = self.r(self.a, self.use_regex, self.use_case)
TypeError: HasCommonAncestorWithFilterMatch.__init__() takes from 2 to 3 positional arguments but 4 were given
David Lynch

GRAMPS: AIO64-5.2.0-r1-6167151
Python: 3.11.8
BSDDB: 6.2.9 (6, 0, 30)
sqlite: 3.45.1 (2.6.0)
LANG: en_GB.UTF-8
OS: Windows

This looks like a bug introduced in commit 8b64b9f.

See PR #1383 - “Add the possibility to search sensitive/insensitive”.

Thank you. Do you want me to submit a bug report? Is there a work around that would allow me to move (most of) my filters?

David Lynch

Yes please.

This is a bug in the HasCommonAncestorWithFilterMatch filter rule. It has not been updated to accept the extra argument which we pass it. A new filter cannot be created using this rule.

I suspect that the same problem may exist in other rules.

https://gramps-project.org/bugs/view.php?id=13187 submitted.

2 Likes

Hopefully fixed in pull request #1659.

1 Like

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