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

Can't map files if the file name has a space in it #98

Open
mForcella opened this issue Sep 4, 2021 · 2 comments
Open

Can't map files if the file name has a space in it #98

mForcella opened this issue Sep 4, 2021 · 2 comments

Comments

@mForcella
Copy link

When the files are uploaded to the server, all spaces are replaced with an underscore. But the xml files retain the original file name with the space. You can do a mass replace easily enough on the xml to fix the issue, but ideally the spaces should be replaced in the output xml file as well.

@ecoecoe
Copy link

ecoecoe commented Dec 26, 2021

Same issue. When I import files, the spaces are replaced with underscore, so the import Errors remain.

Issue reported as early as 2017: #41 (comment)

@ecoecoe
Copy link

ecoecoe commented Dec 27, 2021

A solution could be to comment row 375 of file concrete/src/File/Service/File.php in the function "sanitize" before to start uploading files. This permit to finish the migration process. Naturally is a trick and not a definitive solution. This maintain the name of files with spaces.

This is the row (Concrete5 v. 5.8) that change in the URL of files the underscore "_" instead of space character.
$asciiName = trim(preg_replace(["/[\\s]/", "/[^0-9A-Z_a-z-.]/"], ["_", ""], $asciiName));

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

No branches or pull requests

2 participants