We've noticed files overwriting themselves on migration. If you're importing two files, one named a/1.jpg and another named b/1.jpg, the basename() for both these are 1.jpg even though they are different files in different directories. I'm wondering if in plugins/destinations/fields.inc+190, if we should (a) just pass the $full_path to file_stream_wrapper_uri_normalize() or (b) further make the name unique by changing basename($full_path) to str_replace('/', '-', $full_path). Is this the right place to fix the problem and if so, which solution do you like?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | migrate-fields.patch | 787 bytes | douggreen |
Comments
Comment #1
moshe weitzman commentedI've fiddled with this code a lot trying to make all the file_move, file_copy, and file_save cases work properly. chx just changed it some more. At this point, I'm not quite sure whats needed. We need some tests here for sure. At first blush, that str_replace looks good.
Comment #2
MashMeisterD commentedMoshe - not fully vetted but am seeing properly created nodes and images that were once dupes overwriting each other now creating new fids. Will do a few more tests but so far looks good. Was a significant issue so hope this is a good fix. Would appreciate a review for any gotchas we may be missing.
Comment #3
mikeryanFilefield handling has moved to Migrate Extras, and has changed a bit since the move.
Comment #4
douggreen commentedSorry, I thought I uploaded a patch with this...
Comment #5
mikeryanIt moved back to Migrate a while ago.
Comment #6
mikeryanCommitted, thanks!