Skip to content

Check the file name for valid characters when using "Save As" in the problem editor. #2755

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

Conversation

drgrice1
Copy link
Member

@drgrice1 drgrice1 commented Jun 24, 2025

This ensures that the given file name has the same valid characters that the file manager requires.

Show the message "The text box now contains the source of the original problem. You can recover lost edits by using the Back button on your browser." any time that a save is not going to be done in the save_as handler, since it applies to any of those cases.

Only set the editFilePath when a save really will occur.

Finally, don't show the "File "[_1]" exists. File not saved. No changes have been made." message if no file name is given.

This fixes issue #2754.

@drgrice1 drgrice1 force-pushed the problem-editor-save-as-check-filename branch from 7b95098 to 3778822 Compare June 24, 2025 03:20
@drgrice1
Copy link
Member Author

Eventually we need to eliminate the redirect in these cases when a save is aborted. To deal with that gracefully though, modifications in the CodeMirror window need to be handled better.

@drgrice1
Copy link
Member Author

Note that really, the redirect even in the case that a save does occur should be eliminated. That takes quite a bit of restructuring of the problem editor code though.

…problem editor.

This ensures that the given file name has the same valid characters that
the file manager requires.

Show the message "The text box now contains the source of the
original problem. You can recover lost edits by using the Back button on
your browser." any time that a save is not going to be done in the
save_as handler, since it applies to any of those cases.

Only set the `editFilePath` when a save really will occur.

Finally, don't show the "File "[_1]" exists. File not saved. No changes
have been made." message if no file name is given.

This fixes issue openwebwork#2754.
@drgrice1 drgrice1 force-pushed the problem-editor-save-as-check-filename branch from 3778822 to 47161e4 Compare June 24, 2025 10:07
@Alex-Jordan Alex-Jordan merged commit 9f8bde8 into openwebwork:WeBWorK-2.20 Jun 24, 2025
2 checks passed
@drgrice1 drgrice1 deleted the problem-editor-save-as-check-filename branch June 24, 2025 19:38
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.

3 participants