Skip to content

Commit

Permalink
Fix crash when printing notes during endnote creation
Browse files Browse the repository at this point in the history
Fixes #12983.
  • Loading branch information
Nick-Hall committed Aug 24, 2023
1 parent ed44a70 commit 415aeb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions gramps/gen/plug/report/endnotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,17 @@ def write_endnotes(
cindex += 1

doc.start_paragraph("Endnotes-Source", "%d." % cindex)
doc.write_text(citation[0], links=links)
source, text = citation[0]
doc.write_text(text, links=links)
doc.end_paragraph()

if printnotes:
_print_notes(source, database, doc, "Endnotes-Source-Notes", links)

for key, ref in citation[1]:
for ref, key, text in citation[1]:
# Translators: needed for French, ignore otherwise
doc.start_paragraph("Endnotes-Ref", trans_text("%s:") % key)
doc.write_text(ref, links=links)
doc.write_text(key, links=links)
doc.end_paragraph()

if printnotes:
Expand Down
6 changes: 3 additions & 3 deletions gramps/plugins/cite/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ def format(self, bibliography, db, elocale):

refs = []
for key, ref in citation.get_ref_list():
ref = _format_ref_text(ref, key, elocale)
refs.append([key, ref])
text = _format_ref_text(ref, key, elocale)
refs.append([ref, key, text])

result.append([src, refs])
result.append([[source, src], refs])

return result

Expand Down

0 comments on commit 415aeb4

Please sign in to comment.