I'm using Feeds to import a csv file with a 1000 rows. One of the fields is an uri for images that is mapped to the right image field. All images are stored on the server and with Feeds Tamper I trim the uri (just to be safe) and assign the right source folder. This works well:
- All nodes are successfully imported
- All images are successfully copied to the right folder
- All images are successfully created in the file_managed table (so each one gets its own fid)
However, only 50-60% of the imported nodes actually gets connected to the image file entries. The table that is supposed to connect them (in my case field_data_field_speaker_photo) is just missing a lot of rows, so the imported nodes show up without an image. How could this happen, when all of the above seems to work just fine?
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedcollageboys created an issue. See original summary.
Comment #2
MegaChriz CreditAttribution: MegaChriz as a volunteer commentedThings I can think of:
hook_feeds_presave()
or there is a Rule that reacts on the event "Before saving an item imported via ..." that sets some items to skip from saving. Currently images are saved even if the entity it belongs to is not saved in the end, see this bug report: #2427119: File entities created even when $entity->feeds_item->skip = TRUE;.There can also be a module conflict. Can you try to replicate this issue on a clean install of Drupal and Feeds?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedThanks MegaChriz, for taking the time help me out.
The second scenario is not the one, all images are regular .jpg. The first one should also not be the case, the nodes where not imported before. However, after the first failure I did some deletion/retrying using the same guids... I'm not sure but that probably didn't do any good.
Weird thing is both new nodes and images are imported okay, just not connected well. But at least now I know it's not a common bug, so I'll try to replicate on a fresh install. Thanks again!