Migrate Extras should give FileField a nudge when the directory for the field has not been created yet.

This caused me a lot of grief, since the migration halted half way though the file transfer and would only show the files straight from the PHP temporary upload folder. They would only be displayed on the edit tab, not the full node display.

At least, Migrate Extras should display an error saying the directory does not exist.

CommentFileSizeAuthor
#1 filefield_dir_check.patch743 bytesdpi

Comments

dpi’s picture

Title: File » FileField directory does not exist
Issue tags: +FileField
StatusFileSize
new743 bytes

Attached is a patch that notifies the user that the directory does not exist. No attempt is made to create it, though.

Tested against 6.x-1.0-alpha2

a_c_m’s picture

Version: 6.x-1.0-alpha2 » 6.x-1.x-dev

I ran into this as well, it would leave the files in /tmp/ and then try to link to them from there. Shouldn't it create the folders as needed?

dpi’s picture

It should be up to FileField to create the directory immediately, I'm not sure it would be right to create the directory ourselves.

a_c_m’s picture

humm, normally when you upload a file it does - makes me thing we are doing something strange by creating it programatically thats skipping a step?

frankcarey’s picture

Yeah, I personally ran into this as well. It looks like filefield could create only 1 subdirectory deep. I was using tokens to put files in a structure like "files/field_myfield/[uid]/" Once I created the "files/field_myfield/" directory, it would make the rest of the uid directories. Also watch out for permissions when using drush, as drush runs as YOU, the logged in *nix user, not as your webserver, so you need to share group permissions or just set everything to 777 during the migration. See: #729634: drush migrate-import runs as the system user, which can affect file permissions.

I like danph's warning though because it caused me a lot of pain too, and it would have been nice to at least know what was going on.

frankcarey’s picture

Status: Active » Postponed (maintainer needs more info)

looking at this patch, I think it may give a false positive because like I said, filefield WILL create new paths. Can someone test this out and let us know?

frankcarey’s picture

also, I'm not so sure about my "1 subdirectory deep" assertion. That might have been due to the fact that I created the directory as my linux user, and then the drush script had write permissions for it.

frankcarey’s picture

Category: bug » feature

this isn't a bug with migrate extras - so changing this to a feature request

vitis’s picture

sub

mikeryan’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Migrate and Migrate Extras V1 are no longer supported.