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

Importing a set definition file removes spaces from source_file #2563

Open
dlglin opened this issue Sep 4, 2024 · 1 comment · May be fixed by #2570
Open

Importing a set definition file removes spaces from source_file #2563

dlglin opened this issue Sep 4, 2024 · 1 comment · May be fixed by #2570

Comments

@dlglin
Copy link
Member

dlglin commented Sep 4, 2024

When importing a set definition file all spaces are removed from the source_file field. This causes issues if a pg file genuinely has spaces in the filename as the imported set will not have the correct source_file.

To reproduce:

  1. Create a pg file with a space in the filename and add it to a set.
  2. Export the set. The .def file will include the spaces in the filename.
  3. Import the set into a course. The spaces have been removed from the filename, and the Set Detail page will report that the source file can't be found (unless there happens to be a file with same name with no spaces).

This looks to be done deliberately:

$problemData->{source_file} =~ s/\s*//g;

In earlier versions of WW there were problems with including spaces in filenames, but as far as I can tell everything else now works with them. Can this line be deleted, or might that break something else?

@drgrice1
Copy link
Member

drgrice1 commented Sep 4, 2024

I think it should be okay. We will need to test it extensively though. So a pull request would be good now. Then it will be thoroughly tested by the next release, and any issues with doing so fixed.

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 a pull request may close this issue.

2 participants