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

email: lack of subject causes stack trace #8439

Open
aronatkins opened this issue Jan 25, 2024 · 4 comments · Fixed by #8640
Open

email: lack of subject causes stack trace #8439

aronatkins opened this issue Jan 25, 2024 · 4 comments · Fixed by #8640
Assignees
Labels
backport bug Something isn't working email
Milestone

Comments

@aronatkins
Copy link
Contributor

aronatkins commented Jan 25, 2024

Bug description

The email format errs when the document does not contain a .subject block.

Steps to reproduce

---
title: customized
format: email
---

Not the message.

::: {.email}

The message.

:::
Error running filter /Applications/quarto/share/filters/main.lua:
/Applications/quarto/share/filters/main.lua:7233: attempt to concatenate a nil value (upvalue 'subject')
stack traceback:
	[C]: in ?
	[C]: in method 'walk'
	/Applications/quarto/share/filters/main.lua:224: in function </Applications/quarto/share/filters/main.lua:214>
	(...tail calls...)
	/Applications/quarto/share/filters/main.lua:936: in local 'callback'
	/Applications/quarto/share/filters/main.lua:954: in upvalue 'run_emulated_filter_chain'
	/Applications/quarto/share/filters/main.lua:990: in function </Applications/quarto/share/filters/main.lua:987>
stack traceback:
	/Applications/quarto/share/filters/main.lua:224: in function </Applications/quarto/share/filters/main.lua:214>
	(...tail calls...)
	/Applications/quarto/share/filters/main.lua:936: in local 'callback'
	/Applications/quarto/share/filters/main.lua:954: in upvalue 'run_emulated_filter_chain'
	/Applications/quarto/share/filters/main.lua:990: in function </Applications/quarto/share/filters/main.lua:987>

If the document contains a .subject block, it does not err.

---
title: customized
format: email
---

Not the message.

::: {.email}

::: {.subject}
The subject.
:::

The message.

:::

Expected behavior

When the document does not include a .subject block, the render should still succeed.

The .output_metadata.json file should include a value for the rsc_email_subject field only when the document is providing a subject. When there is no custom subject, the JSON file should either have an empty string value or omit the field.

When Connect renders a document, it provides the RSC_EMAIL_SUBJECT environment variable. This contains the default subject in case folks want to use that value when computing an overridden value. Quarto does not need to interpret RSC_EMAIL_SUBJECT or provide a default subject.

Actual behavior

Stack trace

Your environment

No response

Quarto check output

Quarto 1.4.549
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.549
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/aron/Library/TinyTeX/bin/universal-darwin
      Version: 2022

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.11.7
      Path: /usr/local/opt/python@3.11/bin/python3.11
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/library
      knitr: 1.45
      rmarkdown: 2.25

[✓] Checking Knitr engine render......OK
@aronatkins aronatkins added the bug Something isn't working label Jan 25, 2024
@mcanouil mcanouil added email triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. labels Jan 25, 2024
@cderv cderv added the backport label Jan 25, 2024
@cderv
Copy link
Collaborator

cderv commented Jan 25, 2024

Just a note from @aronatkins : This would be could to add to a 1.4 patch release.

I added the backport label to indicate this

@cscheid
Copy link
Collaborator

cscheid commented Mar 6, 2024

@rich-iannone @cderv Can either of you backport this to v1.4?

@cderv
Copy link
Collaborator

cderv commented Mar 6, 2024

I'll do it. @rich-iannone I can show you how this works.

@cderv
Copy link
Collaborator

cderv commented Mar 6, 2024

@cscheid this is now in v1.4 branch. I updated changelog there too.

@cderv cderv removed the triaged-to Issues that were not self-assigned, signals that an issue was assigned to someone. label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bug Something isn't working email
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants