Repository navigation
Conversation
…itten. If the hardcopy theme for a single problem hardcopy generated by `render_rpc` (for example, from the problem editor) can not be found, then `write_tex` records an error and returns without writing anything to the `hardcopy.tex` file, not even the `\batchmode` line. However, the error was ignored, and hardcopy generation continued with the empty TeX file. When the PDF is generated, LaTeX stops at an error prompt for the empty file. On a production server where the standard input of the server is not a terminal, LaTeX immediately exits, and the user is sent a zip file containing the empty TeX file instead of the error message about the missing theme. On a development server running in a terminal (morbo), LaTeX waits for input from the terminal, and since it is run with `system`, the entire server stops responding until the LaTeX process is killed. Now hardcopy generation stops and the errors are returned if writing the TeX file failed. To reproduce the issue: 1. Create a course hardcopy theme in the course `templates/hardcopyThemes` directory. For example, in the problem editor click "Edit Selected Theme" on the "Generate Hardcopy" tab, and then use "Save As" to save the theme in the course, and make sure to use a different file name. 2. Open a problem in the problem editor, go to the "Generate Hardcopy" tab, and select the course hardcopy theme. 3. In another browser tab, delete the course hardcopy theme using the File Manager (or just delete the file from the command line). 4. In the problem editor click "Generate Hardcopy". The theme menu was created when the page was loaded, so the deleted theme is still sent. Without this change a zip file containing an empty `hardcopy.tex` file is downloaded (or the server hangs if it is running in a terminal). With this change the error message "Couldn't locate file for theme ..." is shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
drgrice1
force-pushed
the
bugfix/hardcopy-invalid-theme-error
branch
from
October 14, 2026 13:29
405b2f8 to
0063c78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the hardcopy theme for a single problem hardcopy generated by
render_rpc(for example, from the problem editor) can not be found, thenwrite_texrecords an error and returns without writing anything to thehardcopy.texfile, not even the\batchmodeline. However, the error was ignored, and hardcopy generation continued with the empty TeX file.When the PDF is generated, LaTeX stops at an error prompt for the empty file. On a production server where the standard input of the server is not a terminal, LaTeX immediately exits, and the user is sent a zip file containing the empty TeX file instead of the error message about the missing theme. On a development server running in a terminal (morbo), LaTeX waits for input from the terminal, and since it is run with
system, the entire server stops responding until the LaTeX process is killed.Now hardcopy generation stops and the errors are returned if writing the TeX file failed.
To reproduce the issue:
templates/hardcopyThemesdirectory. For example, in the problem editor click "Edit Selected Theme" on the "Generate Hardcopy" tab, and then use "Save As" to save the theme in the course, and make sure to use a different file name.Without this change a zip file containing an empty
hardcopy.texfile is downloaded (or the server hangs if it is running in a terminal). With this change the error message "Couldn't locate file for theme ..." is shown.