openwebwork / webwork2

Course management front end for WeBWorK
http://webwork.maa.org/wiki/Main_Page
Other
145 stars 165 forks source link

temporary course name during unarchiving process can be to long #2417

Open Alex-Jordan opened 4 months ago

Alex-Jordan commented 4 months ago

A course name cannot be more than 40 characters long. Now suppose you have a course with name foo except that is 37 or more characters long, and you archive it (leaving the original course in place).

Then you try to unarchive the archive, but give it a new name that is under 40 characters long. The way this is done right now, WW temporarily works with a course name that is foo_tmp, which is longer than 40 characters long. So even though your proposed new name for the new course would be under 40 characters long, the foo_tmp name triggers an error about a course name being too long.

Alex-Jordan commented 4 months ago

I got around this by temporarily renaming the original course (which was still live) to something short. Then I archived it and created the new course with a new name using the short-named archive. And then returned the original course to its original name. So for a minute or so the original course was not accessible.

I couldn't find another workaround. You can't simply rename a course archive file and expect that it will unarchive to a course with a name based on how you renamed the file.