I spent about an hour trying to decipher the MigrateFile class 'DestinationDir' sub-field, with file migrations failing, even though the files were available. The problem was a misinterpretation of the nature of the field value.
The migrate field description is: "Path within Drupal files directory to store file"
This is not clear. The default value for the sub-field is 'public://'. The variable holds a full Drupal File Scheme uri. Any passed values need to still be a full uri, not a path for inside the files directory (public://[path_inside_files_directory]).
In my case it was hard to determine where the file migration was failing. I had a subfolder for inside the files directory, which as an absolute url the server didn't have the permissions to create.
Perhaps something like this would be more clear: "Drupal path uri to the directory to store file (defaults to public://)"
I am not sure how comfortable most migrators are with the Drupal URI schemes, but I would assume that the level is high, so just seeing the default suggestion would inform that a scheme uri is used.
Comment | File | Size | Author |
---|---|---|---|
#1 | migrate-better_file_handler_description_destinationdir-1845590.patch | 865 bytes | jaxxed |
Comments
Comment #1
jaxxed CreditAttribution: jaxxed commentedHere is a patch using my example text
Comment #2
jaxxed CreditAttribution: jaxxed commentedComment #3
mikeryan"Drupal path uri directory" doesn't make much sense to me. How about "Drupal path of parent directory to hold the file"?
Comment #4
pifagor