Hi,

I am currently using the Feeds module to import data related to books (Title, Description, Author, Cover image and price) from csv files.
Everything is running smoothly.

The cover image is mapped to a "Image" field. The URL for the remote image is correctly parsed and the image is saved in the local Drupal environment.

I import data on a daily basis. Now, let's assume that the price (and the price only) has changed for 1000 items. The Feeds module uses the previously stored hash to detect if the item has changed. In this specific case, these 1000 items will all be updated as the price has changed (and so the hash of each node).

This means that all 1000 cover images will be re-downloaded again, even if the images have not changed. Is there a way to prevent this? I know that I could remove the image URL from the CSV file if the image has not changed before parsing it with Feeds, but that could be a little tricky.

What I have done so far: I have added a text field to the books type to store the full URL of the image. I would like to compare the new URL with the stored one and skip the processing for the "cover image" field during data import.

I have tried to use the hook_feeds_before_update , trying to unset the field_cover_image from the $item array, but I guess that doesn't have any impact on the processing.

Any ideas would be really appreciated.

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jason Dean’s picture

I have a similar problem running Feeds 7.x-2.0-alpha8, using Node Processor (set to update existing nodes) and XPath XML Parser.

I'm pretty sure that using previous versions of Feeds 7.x, mapped fields would only get updated if the source for that field had changed. For example:

  • My importer imports title and body fields
  • I manually edit a node and change the body field
  • In the source feed, the title is changed
  • On the next import, only the node title is updated and my body field stays the same

Now it seems that the body field gets overwritten too, even though it hasn't changed in the source?

Note: I have not selected the 'skip hash check' option.

Jason Dean’s picture

Issue summary: View changes

wrong hook name

bkosborne’s picture

Status: Active » Closed (outdated)
FileSize
43.77 KB

This appears outdated. Feeds has options to control image handling now, and one of them is to "skip" the file processing entirely if it's determined that the target filename already exists on your site:

show the new settings

bkosborne’s picture

MegaChriz’s picture

@bkosborne
Thanks for cleaning up the issue queue. I see the suggestion in #2 as a workaround: if the image contents changed, but the file name did not, the image won't be updated on the target site with the selected setting. The setting also has no effect when using the filefield_paths module.

@Jason Dean
Feel free to reopen this issue, if you still encounter this problem.