Closed (fixed)
Project:
Feeds Image Grabber
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Dec 2011 at 17:49 UTC
Updated:
15 Nov 2012 at 10:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
MrNeko commentedHi I tried applying the patch but it doesn't let me. Tried on latest 7.x-1.x-dev using netbean. Can anyone help me with this? Thanks.
Comment #2
rooby commentedThanks, that should fix it (just looking at the code, haven't tried to apply yet).
Better would be an option to choose what to do when there are multiple images but that can be another feature added later (#1793998: Give options for what to do if multiple images are found).
Comment #3
rooby commented@MrNeko,
When I get a chance I'll try it and re-roll it if necessary.
If you are feeling adventurous you could also apply it manually seeing as it is so small.
All you have to do it put the
$image_count++;line in where it goes.Comment #4
acrollet commentedThe patch in the summary applies cleanly to 7.x-1.x-dev for me - works great, it would be good to get this in since it greatly affects the central functionality of this module.
Comment #5
acrollet commentedI spoke a bit too soon, the attached patch increments the image counter before checking to see if it is equal to the cardinality setting. This prevents an additional image from being downloaded and cluttering up the files directory. There is also a bit of whitespace cleanup for the function in this patch.
Comment #6
rooby commentedThanks, I will do a run of review / commits tonight.
Comment #7
rooby commentedGood catch.
I have committed this minus the whitespace fixes. I will fix those in a separate commit. Best to keep them separate.
I also also added a change so that it only sets the field once instead of overwriting it every new image.
http://drupalcode.org/project/feeds_imagegrabber.git/commit/5cbea2b