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

Fix rendering static images when checking answers in the PG problem editor. #2574

Merged

Conversation

drgrice1
Copy link
Member

This fixes issue #2556 essentially as @somiaj suggests (although there is no need to first check that $rh->{fileName} is defined).

The reason that $rh->{fileName} is defined is because the default.html.ep template always adds the fileName hidden field even when the fileName parameter is not defined in the original request. So if you click "Check Answers" it will be defined in RenderProblem.pm on that request.

@drgrice1 drgrice1 force-pushed the render-problem-non-empty-filenames branch from 0294d84 to b615eac Compare September 18, 2024 20:34
Copy link
Contributor

@somiaj somiaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this and double checking there wasn't a better fix.

Could this also be a hotfix?

@drgrice1 drgrice1 force-pushed the render-problem-non-empty-filenames branch from b615eac to 7af6b76 Compare September 28, 2024 23:22
@Alex-Jordan
Copy link
Contributor

I haven't followed this issue, have not tried to understand the relevant code, and have not tested anything :)

Just purely from looking at the code change from boolean testing $rh->{fileName} to defined $rh->{fileName}, is it never the case the the $rh->{fileName} is '0'? Sounds like a bad choice for a filename, but I try not to judge.

And is it never the case that $rh->{fileName} is defined, but has somehow wound up being empty?

@drgrice1
Copy link
Member Author

drgrice1 commented Oct 3, 2024

A filename of 0 also does not work in assignments. So I don't think it needs to (or even should be) supported here. Note that a filename of 0.pg does work in assignments and will work here.

@drgrice1 drgrice1 force-pushed the render-problem-non-empty-filenames branch from 7af6b76 to 7e01b0c Compare October 18, 2024 15:13
@drgrice1 drgrice1 force-pushed the render-problem-non-empty-filenames branch from 7e01b0c to 87700bf Compare October 29, 2024 19:29
…ditor.

This fixes issue openwebwork#2556 essentially as @somiaj suggests (although there
is no need to first check that `$rh->{fileName}` is defined).

The reason that `$rh->{fileName}` is defined is because the
`default.html.ep` template always adds the `fileName` hidden field even
when the `fileName` parameter is not defined in the original request. So
if you click "Check Answers" it will be defined in `RenderProblem.pm` on
that request.
@drgrice1 drgrice1 force-pushed the render-problem-non-empty-filenames branch from 87700bf to 1f2fd3a Compare November 11, 2024 21:33
pstaabp added a commit that referenced this pull request Nov 12, 2024
…ames-hotfix

Fix rendering static images when checking answers in the PG problem editor (hotfix of #2574)
@pstaabp pstaabp merged commit 0448efb into openwebwork:develop Nov 12, 2024
2 checks passed
@drgrice1 drgrice1 deleted the render-problem-non-empty-filenames branch November 13, 2024 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants