I have a couple news sites set up and they use Feeds, as well as Feeds image grabber. Due to the volume, I have the news items imported automatically delete after 10 days. It would be ideal to my server's stability & overall well-being (it's temperamental sometimes) if the images were to go away along with the imported feed, rather than have old images just stay there indefinitely.

Is this something already there that I missed, or is this something I have to set up myself?

Comments

brks’s picture

According to my experience, when the feed item(node) is deleted manually, the one image in the feed item(node) will be deleted as well.

However, if the original article has more than one images, say 5 of them, the module will download all 5. Only 1 appears in the node, the other 4 are in the file folder as well. When you delete the node, only 1 image deleted along with the node, and the other 4 remains. Furthermore, the information of the 4 nodes are still in your data base. You can manually delete the 4 images and the information in database; but since you have a lot of images to handle at the same time, it is not so easy to filter out the 4 images and the information in the database. I still wonder if this can be solved through configuration, or it is an issue of the module.

rooby’s picture

Only 1 appears in the node, the other 4 are in the file folder as well.

Sounds like that is a bug that could have its own issue.

rooby’s picture

@skyline5k:

However, if the original article has more than one images, say 5 of them, the module will download all 5. Only 1 appears in the node, the other 4 are in the file folder as well. When you delete the node, only 1 image deleted along with the node, and the other 4 remains.

Is that what you are experiencing or are you only dealing with a single image and it is not being deleted?

If it is only a single image then it is a feeds problem (I assume feeds is what you are using to remove the nodes after 10 days, if not it is whatever module is doing the deletions), because as brks says, if a node is properly deleted its images will also be deleted.

Unless of course that image is used on other nodes within that 10 days, in which case the image will remain for its other node(s).

rooby’s picture

brks’s picture

@rooby, thank you so much for the solutions!
I will let you know once I use the patches.

brks’s picture

I've edited the feeds image grabber according to patch mentioned above (as @rooby mentioned in the link he quoted above, just put $image_count++; at the right place), and now it could grabber all the images.

If the feed item (node) is deleted, the images in it are all deleted from the server and the database is cleared accordingly. This is great!

@rooby, thank you again.