I have a large (~6k) CSV feed which contains images that I need to import periodically. I have an image_url field in the import which is set to public://some_image_file.jpg and the images are located at sites/default/files/some_image_file.jpg. Everything seems to work, except that I'm finding that the images are copied from public://some_image_file.jpg to public://some_image_file_[N].jpg.
I'm a relative newcomer to the Drupal API (especially the File API), but a cursory glance at the code in feeds/plugins/FeedsParser.inc (specifically the getFile() method of class FeedsEnclosure) leads me to believe that the issue is at line 343 where file_save() is called, even if the file exists.
Is this the intended behavior? If so, is there a solution to this issue?
Comments
Comment #1
merilainen commentedI don't have exactly the same problem, but something fishy is going on in the getFile() method. My importer seems to run every time even when I don't change the source file and I think it's saving the files again and again, although I don't get any new files after import. I can see that the amount of files in the folder changes during the import, so some temporary files are being imported. This is very problematic with xml-feeds and lots of images.
Comment #1.0
merilainen commentedfixed formatting :P
Comment #2
bluegeek9 commentedDrupal 7 reached end of life and the D7 version of Feeds is no longer being developed. To keep the issue queue focused on supported versions, we’re closing older D7 issues.
If you still have questions about using Feeds on Drupal 7, feel free to ask. While we won’t fix D7 bugs anymore, we’re happy to offer guidance to help you move forward. You can do so by opening (or reopening) a D7 issue, or by reaching out in the #feeds channel on Drupal Slack.
If this issue is still relevant for Drupal 10+, please open a follow-up issue or merge request with proposed changes. Contributions are always welcome!