Drupal 6.17 / Migrate Extras 6.x.1-beta1 / Migrate 6.x.1.0 / FileField 6.x.3.3
I am trying to migrate nodes that have optional filefield (mp3) files. Nodes with the filefield path populated will migrate correctly, but nodes with an empty path fail with the following error:
"warning: filesize() [function.filesize]: stat failed for NULL in /Users/myname/Sites/acquia-drupal/modules/acquia/filefield/field_file.inc on line 154.
The selected file NULL could not be saved. Only files with the following extensions are allowed: mp3."
I tried the patch suggested in http://drupal.org/node/780920 (Node Not Saving When Filefields Are Empty or Null) but this has no effect.
I also tried removing the 'allowed filetypes' setting, which was set to allow MP3 files only. Again, no effect.
I have a massive migration task ahead of me, so would like to get this nailed if I can - any advice appreciated.
Thanks
JB
Comment | File | Size | Author |
---|---|---|---|
#2 | migrate_extras.patch | 2.36 KB | robertDouglass |
Comments
Comment #1
quicksketchI'd be happy to accommodate for this in FileField if a patch is provided, but since I've never used Migrate Extras it's hard for me to know where to start. My feeling is that it's unlikely this is a problem with FileField, since I know you can node_save() and set FileField properties just fine in customized scripts. This is probably a problem with Migrate Extras not setting the properties correctly.
Comment #2
robertDouglass CreditAttribution: robertDouglass commentedThis is an easy fix. It just fails when there is no source file, whether that is because it isn't supposed to have one, or because the source file is missing. Both cases come up regularly in migrations. The code is just missing an if (file_exists()), which this patch provides. The added error message lets you go back and audit the migration and take remedial actions where files are missing.
Comment #3
robertDouglass CreditAttribution: robertDouglass commentedThis is what the patch looks like ignoring whitespace:
Comment #4
wapnik CreditAttribution: wapnik commentedunfortunately i provided a duplicate at #867304 and i'm starting a poll about whose message is prettier? :)
Comment #5
tobiassjosten CreditAttribution: tobiassjosten commentedPatch in #2 has been merged with patch for #731992: multi-value filefields and it's working like a charm. It's obviously not a duplicate issue but perhaps a duplicate fix is valid? :)
Comment #6
mikeryanMigrate and Migrate Extras V1 are no longer supported.