Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use date-specific place in report substitution variables #1405

Merged
merged 1 commit into from
May 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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