Closed (fixed)
Project:
Migrate
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Aug 2012 at 08:53 UTC
Updated:
2 Oct 2012 at 01:54 UTC
File migration fails when the file path contains white space(s).
Problem occurs in MigrateFile::copyFile() in plugins/destinations/file.inc at line 336.
if (!@copy($this->sourcePath, $destination)) {
This is easily fixed by replacing the line with:
if (!@copy(str_replace(' ', '%20', $this->sourcePath), $destination)) {
Comments
Comment #1
mikeryanThis is already fixed in -dev.
Comment #3
stockliasteroid commentedSorry to resurrect this, but I upgraded to -dev and a large number of my files started failing to import. All of the failures have spaces in the filenames, which Migrate is replacing with %20 as outlined above. For some reason that's causing the copy to fail, because the with 2.4 without the %20 replacement it worked fine. Could this be some kind of OS-specific issue? I've run the same migrations prior to upgrading to -dev on both OSX and Ubuntu machines and they worked on both, but now work on neither with -dev. I reverted back to 2.4 and now it works fine again...
Let me know if I should open a new issue, but this is definitely tied to this change.
Comment #4
stockliasteroid commentedChanging version.
Comment #5
mikeryanPlease don't tack on to closed issues - always open a fresh issue. When you do, please look at examples of filenames which no longer work versus those that do - you may find that the failures are where the filename is already urlencoded.
Comment #6
stockliasteroid commentedYeah, thought I'd get slapped for that. I considered this a regression, and thus the same issue would apply. My apologies: #1800616: Whitespace in file uri is urlencoded and breaks file copy with MigrateFileUri
Comment #6.0
stockliasteroid commentedFormatting