Situation: D7 site using feeds 7.x-2.0-alpha8 with some feeds configured to import files and images and some that don't do that.
Client required the deletion of nodes that were no longer in feeds, so the site was upgraded to latest dev (7.x-2.0-alpha8+33-dev) release of Feeds in order to apply patch - https://drupal.org/node/1470530#comment-8777493
Patch worked.
The bug is that either of those updates messed up the feeds that imported files and images.
The node processor mapping turned from "File" to "Missing" at /admin/structure/feeds/XXXXX/mapping
The fix is to create a new mapping for that field, like "File: URI" and fill it with the same info as before and move it to the "missing" one. Same goes for tamper. Then delete the source with missing target.
The only thing that happened was the log got loads of these warnings:
Warning: Invalid argument supplied for foreach() in file_field_presave() (line 218 of /modules/file/file.field.inc)
(and lines 268 and 294).
The cause (not the actual one, just that a mapping was missing) and fix were really hard to track down and I hope this saves someone some headache.
Comments
Comment #1
lunk rat CreditAttribution: lunk rat commentedSame thing happened here. Re-adding the mapping as
image: uri
worked for me.Comment #2
MegaChriz CreditAttribution: MegaChriz commentedThis change was made in #1080386: Add mapping for title and alt fields on images.. Since it apparently breaks existing importer configuration, we should make a change record for it.
Comment #3
vinmassaro CreditAttribution: vinmassaro commentedWe ran into this recently, and this will cause issues for us when deploying to many sites that use Feeds importers with file or image mappings. Is there a way to fix this programmatically?
Comment #4
vinmassaro CreditAttribution: vinmassaro commentedIt seems that the only thing that changes on the File or Image mappers in the database is the addition of the
:uri
to the field name. Does anyone have a suggestion to programmatically add this?Comment #5
vinmassaro CreditAttribution: vinmassaro commentedI worked on this yesterday and was able to come up with a proposed fix via upgrade hook. Please review #2341407: Fix missing file/image mappings caused by #1080386 by adding :uri to mappings. Thanks!
Comment #6
MegaChriz CreditAttribution: MegaChriz commentedThe change record is written.