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

lunk rat’s picture

Same thing happened here. Re-adding the mapping as image: uri worked for me.

MegaChriz’s picture

Title: File / Image type field mapping is missing » Add change record for file/image target is missing when upgrading from 7.x-2.0-alpha8
Category: Bug report » Task
Issue tags: +Needs change record

This 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.

vinmassaro’s picture

We 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?

vinmassaro’s picture

It 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?

vinmassaro’s picture

I 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!

MegaChriz’s picture

Status: Active » Fixed
Issue tags: -Needs change record

The change record is written.

Status: Fixed » Closed (fixed)

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