Skip to content

Commit

Permalink
Use date-specific place in report substitution variables
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GaryGriffin authored and Nick-Hall committed May 14, 2023
1 parent 36d0313 commit 181e2d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gramps/plugins/lib/libsubstkeyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def get_place(self, database, event):
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 """
Expand Down Expand Up @@ -432,6 +432,8 @@ def format_place():
""" 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():
Expand Down Expand Up @@ -889,6 +891,8 @@ def __parse_place(self, event):
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)
Expand Down

0 comments on commit 181e2d8

Please sign in to comment.