kkujansuu / gramps

MIT License
1 stars 1 forks source link

Recursion handling missing #16

Closed HelgeGitHub closed 1 year ago

HelgeGitHub commented 1 year ago

You need to handle recursions (seeattached file for two recursive each other calling filters). This was also one of my Ideas, to have a check for recursions. If I try to delete one with your plugin, Gramps first sent a warning, that also the second filter (called by his name will be deleted). But Gramps crashes afterwards without deleting the filter but also without crashing the whole Gramps (as Gramps does if one uses such a filter).

This is the error message regarding your plugin in this case. But of course if there is no handling for recursions the plugin has to crash in this way. 1903882: ERROR: grampsapp.py: line 157: Unhandled exception Traceback (most recent call last): File "C:\Programme\GrampsAIO64-5.1.3\gramps\plugins\FilterParams\FilterParams.py", line 352, in delete_filter parent=self.dialog) File "C:\Programme\GrampsAIO64-5.1.3\gramps\gui\dialog.py", line 125, in init task() File "C:\Programme\GrampsAIO64-5.1.3\gramps\plugins\FilterParams\FilterParams.py", line 390, in _do_delete_selected_filter self._do_delete_filter(self.current_category, gfilter) File "C:\Programme\GrampsAIO64-5.1.3\gramps\plugins\FilterParams\FilterParams.py", line 396, in _do_delete_filter self._find_dependent_filters(space, gfilter, filter_set) File "C:\Programme\GrampsAIO64-5.1.3\gramps\plugins\FilterParams\FilterParams.py", line 373, in _find_dependent_filters self._find_dependent_filters(space, the_filter, filter_set) File "C:\Programme\GrampsAIO64-5.1.3\gramps\plugins\FilterParams\FilterParams.py", line 373, in _find_dependent_filters self._find_dependent_filters(space, the_filter, filter_set) File "C:\Programme\GrampsAIO64-5.1.3\gramps\plugins\FilterParams\FilterParams.py", line 373, in _find_dependent_filters self._find_dependent_filters(space, the_filter, filter_set) [Previous line repeated 973 more times] File "C:\Programme\GrampsAIO64-5.1.3\gramps\plugins\FilterParams\FilterParams.py", line 364, in _find_dependent_filters filters = self.filterdb.get_filters(space) File "C:\Programme\GrampsAIO64-5.1.3\gramps\gen\filters_filterlist.py", line 76, in get_filters plugins = PLUGMAN.process_plugin_data('Filters') File "C:\Programme\GrampsAIO64-5.1.3\gramps\gen\plug_manager.py", line 518, in process_plugin_data for plugin in self.pgr.general_plugins(category): File "C:\Programme\GrampsAIO64-5.1.3\gramps\gen\plug_pluginreg.py", line 1344, Screenshot 2022-09-17 120702 in general_plugins plugins = self.type_plugins(GENERAL) File "C:\Programme\GrampsAIO64-5.1.3\gramps\gen\plug_pluginreg.py", line 1281, in type_plugins return [x for x in self.__plugindata if x.ptype == ptype] File "C:\Programme\GrampsAIO64-5.1.3\gramps\gen\plug_pluginreg.py", line 1281, in return [x for x in self.plugindata if x.ptype == ptype] RecursionError: maximum recursion depth exceeded

BTW: Gramps does run into a total chrash with the same recursive filter.

kkujansuu commented 1 year ago

Should be fixed in the new version 1.1.0.

HelgeGitHub commented 1 year ago

Confirmed, the main issue will be prevented now. I would like to suggest a further improvement: The information about the recursion should be visible also on top of the dialogue, not at the end of loop only. Currently this information is often outside the direct visible part of the dialogue and there is the need to scroll down to find it.