Closed (duplicate)
Project:
Feeds
Version:
6.x-1.0-beta10
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
5 Aug 2011 at 09:57 UTC
Updated:
9 Mar 2013 at 23:09 UTC
The attached patch will add an option to the node processor settings screen, which will give a user the option to unpublish or delete nodes that were previously created by the feed import that no longer exist in the feed.
This was a request for a client i have that is using the drupal feeds module and i thought that it maybe useful to other developers using the feeds module.
| Comment | File | Size | Author |
|---|---|---|---|
| feeds.patch.zip | 3.52 KB | psycleDA |
Comments
Comment #1
carsonblack commentedHello,
Thanks for this! I had some issue when trying to apply the patch to 6.x-1.0-beta11. I resolved them manually. But nonetheless here's what I got:
patching file feeds.module
Hunk #1 succeeded at 661 (offset 27 lines).
can't find file to patch at input line 107
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -upr feeds/plugins/FeedsNodeProcessor.inc feeds/plugins/FeedsNodeProcessor.inc
|--- feeds/plugins/FeedsNodeProcessor.inc 2010-10-25 22:43:04.000000000 +0100
|+++ feeds/plugins/FeedsNodeProcessor.inc 2011-07-14 12:29:17.000000000 +0100
--------------------------
File to patch: [path to]/sites/all/modules/feeds/plugins/FeedsNodeProcessor.inc
patching file [path to]/sites/all/modules/feeds/plugins/FeedsNodeProcessor.inc
Hunk #1 succeeded at 14 (offset -1 lines).
Hunk #2 FAILED at 175.
Hunk #3 succeeded at 271 (offset 18 lines).
Hunk #4 succeeded at 283 (offset 18 lines).
Hunk #5 succeeded at 426 (offset 18 lines).
1 out of 5 hunks FAILED -- saving rejects to file [path to]/sites/all/modules/feeds/plugins/FeedsNodeProcessor.inc.rej
can't find file to patch at input line 290
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -upr feeds/plugins/FeedsProcessor.inc feeds/plugins/FeedsProcessor.inc
|--- feeds/plugins/FeedsProcessor.inc 2010-09-10 15:44:56.000000000 +0100
|+++ feeds/plugins/FeedsProcessor.inc 2011-07-14 10:32:50.000000000 +0100
--------------------------
File to patch: [path to]/sites/all/modules/feeds/plugins/FeedsProcessor.inc
patching file [path to]/sites/all/modules/feeds/plugins/FeedsProcessor.inc
Hunk #1 succeeded at 6 (offset -1 lines).
Thanks again,
Carson
Comment #2
travisc commentedAwesome, Maintainer please include this feature in Feeds... Anyway to get an D7 version?
Comment #3
wernerglinka commentedI second #2
Comment #4
tobias- commentedI also second #2 and also for 7.x
Comment #5
Psycle Interactive commentedI have created a 6.x-1.0-beta11 version of this patch, it can be found at http://drupal.org/node/1470530.
I will be working on a D7 version of this feature when time allows.
Comment #6
jboese commentedAlso waiting on D7 version.
Comment #7
-otto- commentedbumpy for D7
Comment #8
jeni_dc commentedNot sure if these are duplicate efforts, but anyone viewing this thread might want to check this out:
#661314: "Sync" or "cache" mode
Comment #9
Psycle Interactive commentedTo those requesting a D7 version, a port of the patch has been created in http://drupal.org/node/1470530
I am currently testing the patch and will post back in the linked thread what i find.
Comment #10
alCHE commentedsubscribe for D7
Comment #11
jelo commentedI am looking for the same feature, but I am not sure if the proposed solution will work in many scenarios. If you e.g. bring in content from sources such as YouTube, the items in the feed are limited to the latest 20 items. I am looking for a solution that can deal with outdated imported content by going to the source itself, instead of the feed who might not include the item anymore just because they only give you the latest few items. After thinking about it, I don't think that feeds should necessarily deal with this because I believe there are better suited other solutions already.
Example:
In the past months I have imported hundreds of videos as nodes based on my criteria. The problem now is that some of these videos get removed from YouTube (sometimes many weeks after the initial upload, i.e. the item is definitely not going to be in the feed anyway). My site is then left with a node that includes description etc. of the video and even the player, but if you try to play the video the user gets an error message. If you tried to use this patch, you would basically disable any item that is not in the feed any more which would restrict it to the same number of items that come through the feed. I rather want to have a record for all items that are still active and only remove items that are not active.
A solution I can see is using the module linkchecker http://drupal.org/project/linkchecker. If you import your content including the source link into a link field, link checker seems to be able to check for 404 errors for CCK fields of type "link". I haven't tried it yet, but based on their feature list on the module page, you should be able to configure it to check all those imported nodes and deactivate the ones that return 404s.
This solution could apply to your scenario as well. If we can assume that an item only gets removed from a feed (that includes all items) when it becomes unavailable, linkchecker would pick up on it and remove that piece of content from your Drupal site.
Comment #12
nedjoDuplicate of #1470530: Unpublish/Delete nodes not included in feed, which has a newer patch.