I have found that there is a bug in the migrate code for files where it will not set the filename or the filemime when using the file_link or file_blob operation. This is due to a strange occurance where in all of the other operations the file is based on the source object that is previously built using "$file = clone $source;" however when using file_link or file_blob it instead declares a new object and doesn't have those parameters set (code: "$file = new stdClass;").

The fix is to replace the latter with the former. I have done that in my code and I will attach the patch here to my first comment. Let me know if there was a reason for doing it the other way in the first place. So far I can't see one.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

patrick.thurmond@gmail.com’s picture

Status: Active » Needs review
FileSize
672 bytes

Here is the patch.

mikeryan’s picture

Status: Needs review » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.