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
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.
Actually I have made a lot of changes already after switching to gramps 5.2.2. Just now I realized, that all my filters from gramps 5.1 are gone. Actually when I reistall 5.1 and import an old backup (scheme 18) all my filters are available.
Any idea how I can migrate all my filters to the most recent tree in 5.2.2. I did read something in Restoring 5.1 filters into 5.2, but dont understand what steps need to be done to accomplish.
The custom filters are NOT stored in database. They are in a separate XML file.
The first step is to install any add-on Rules to your 5.2.2 installation.
If a Custom Filter uses a Rule that isnât installed, then earlier version of Gramps would simply discard the Filter ⌠with no alert. Iâm unaware if 5.2.2 has changed this behavior. So installing add-on rules (including the âGenericâ ones that come with SuperTool) is a prophylactic measure.
If youâve added any custom filters that you want to keep, youâll have to manually splice the 5.1 filters into the 5.2 custom_filters.xml file.
Hopefully you havenât created complex new filters and can just copy the old gramps51/custom_filters.xml overtop the gramps52/custom_filters.xml file.
However, the path for the Gramps User Directory may be different. Your profile doesnât say which OS you use. Windows definitely has a different path.
Thanks a lot. I could identify the path - it is AppData in the user directory since I am windows 10. All addOns have been installed anyway, thus I just copied custom_filters.xml and it worked perfectly.
There is another thread that talks about where user files are created.
The short version is that if 5.2 is the first version you install on a computer %localappdata% is used. If older versions of Gramps have been installed %appdata% will still be used for 5.2
Thatâs make Gramps virtually impossible for tech support. I will object to that approach as loudly and as often as I can. (I accept that doing so is going to be ineffective and probably annoying. It is my personal opinion but please donât take it personally.)
It is also why I objected strenuously to the change before 6.0