From 181e2d854066e36cae7c580e8b45899ed6a3fdb0 Mon Sep 17 00:00:00 2001 From: GaryGriffin Date: Thu, 8 Dec 2022 15:11:35 -0800 Subject: [PATCH] Use date-specific place in report substitution variables Fix place title in graphical reports which have user-defined display formats to use date-specific alternate name. This impacts Ancestor Tree, Descendant Tree, and Family Descendant Tree. Fixes #12763. --- gramps/plugins/lib/libsubstkeyword.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/lib/libsubstkeyword.py b/gramps/plugins/lib/libsubstkeyword.py index 3a9d5d34a..23faa0a19 100644 --- a/gramps/plugins/lib/libsubstkeyword.py +++ b/gramps/plugins/lib/libsubstkeyword.py @@ -346,7 +346,7 @@ class PlaceFormat(GenericFormat): return None def _default_format(self, place): - return _pd.display(self.database, place) + return _pd.display(self.database, place, place.event_date) def parse_format(self, database, place): """ Parse the place """ @@ -432,6 +432,8 @@ class EventFormat(GenericFormat): """ start formatting a place in this event """ place_format = PlaceFormat(self.database, self.string_in) place = place_format.get_place(self.database, event) + if event and place: + place.event_date = event.get_date_object() return place_format.parse_format(self.database, place) def format_attrib(): @@ -889,6 +891,8 @@ class VariableParse: return the result """ place_f = PlaceFormat(self.database, self._in) place = place_f.get_place(self.database, event) + if event and place: + place.event_date = event.get_date_object() if self.empty_item(place): return return place_f.parse_format(self.database, place)