There is no control to affect whether new feed items are loaded (that I could find), and even if a feed is unpublished, it still keeps working like it is active, which I therefore consider a bug. Searched and did not find an existing issue for this.

CommentFileSizeAuthor
#15 FeedsSource.inc_.txt22.3 KBflorentcm
#7 unpublished_feed.patch1.4 KBjyee
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

netentropy’s picture

I do not consider this a bug. I like the fact the feed is unpublished but the feed items are published. This way the feed node does not have to be shown but the imported content is.

alex_b’s picture

Title: If feed node is unpublished, it still keeps spawning new feed items » Pause single feed nodes
Category: bug » feature

This is an issue of contention : ) I remember implementing pausing feeds when the feed node is unpublished for FeedAPI and promptly getting a bug report on that.

I lean towards making pausing feeds a separate options for 2 reasons:

1. on the UI, published/unpublished status is not clearly linked to whether a feed is paused/active (could be amended).
2. published/unpublished status requires administer node permissions.

Either way, I don't think the current situation is a bug (am I missing something?). I'm making this a feature request.

Michelle’s picture

I came searching the queue with the idea that this was a bug when my testing showed that unpublished feeds were still pulling in items. To me, an unpublished node should not be doing anything except taking up a bit of space in the database.

However, I'm fine with using an alternate if that's the consensus. For my use case, I want any member to be able to create a feed node but not have it start pulling in feeds until it's approved. I had planned on setting the node type to start out unpublished as a way to do this.

Whatever method you go with to allow for inactive feeds, could you please make sure it's something where the new feed nodes can default to inactive and only be changed by a permissioned user?

Thanks,

Michelle

alex_b’s picture

AntiNSA’s picture

subscribe

jyee’s picture

I would contend that unpublished feed importing is a bug because it does not simply affect feeds that were once published, then later unpublished to "pause" them. If you create a feed node as unpublished, feeds will still import the feed content. As such, it's impossible to enable any sort of moderation on a feed/feed node (e.g. a user creates a feed node, but an admin must publish it for the feed to begin importing content).

However, pausing a feed should be a separate setting, as there are a variety of reasons one would want to pause a feed... and those are different (and would often require different permissions) than publishing/unpublishing.

jyee’s picture

FileSize
1.4 KB

I'm including a patch I wrote that modifies the includes/FeedsSource.inc. Essentially it allows FeedsSource to get and store the feed node status when the object is constructed. When the import() is called, the function will exit early and not actually run the import if the feed node is not published.

I suspect there's probably a better way to do this, especially since i'm not so good with OOphp, but the patch works for my needs... so i thought i'd share it in case it could help someone else.

Anonymous’s picture

@#7 I see you add another node_load(), I really hate that for performance...

All we need is that the $source gets a $source->status option, a checkbox, on the feed node edit page. Right where you add the link to your feed, could be a checkbox "active" / "not active". The feeds scheduler can read that, so inactive feeds dont get scheduled at all.

jyee’s picture

@morningtime:

yes, another node_load() isn't good for performance, but it's required because, per my message in #6, feeds needs to respect $node->status. The published/unpublished issue is a bug.

Your suggestion for an "active/not-active" checkbox is good, but I would agree with alex_b that it is a feature request and separate from the publish/unpublished issue. Or, in other words, there is a valid use case where feed nodes should remain published, but not actively pull new feed content. Publishing is a workflow process, pausing is an activity function.

alex_b’s picture

#7: What's needed is a pausing on the FeedsScheduler level. #867910-9: Override schedule period will lay the groundwork for this functionality.

alex_b’s picture

Note: We will have to make sure that PubSubhubbub notifications get ignored when a feed is paused.

Michelle’s picture

The issue in #10 got marked duplicate in favor of the issue to create the jobscheduler, which is done, so where does that leave us with this issue? I understand I'm not terribly helpful here because I'm not contributing, so please take this as a request for an update, not me pressuring you. :)

Michelle

Robin Millette’s picture

Regarding #10, wouldn't unsubscribing be preferable? I'm willing to work on this.

Michelle’s picture

It's a bit of scope creep so possibly should be another issue, but I'm putting it here just as a suggestion. With the core aggregator, you can set how often a feed is pulled in. If that ability were added, it would make sense to add another option to that feature for "never" which would be the same as pausing it. I would prefer to have that, actually, because I have some feeds that are updated daily and some that are rarely ever updated and there's no point scanning those on every cron.

Again, this is just a suggestion. I simply don't have the bandwidth to do anything more than test what someone else writes so I'm not demanding you do it my way or anything. :)

Michelle

florentcm’s picture

FileSize
22.3 KB

Our need : we wanted to stop the periodic importation after a time delay. How to stop the import periodically after a set time? We thought that we could do that with the expire field, but expire field contains time after which a created article will be delete from database. We found thanks to jyee and his patch unpublished_feed.patch that it was possible to stop importation of data from unpublished articles . We decided to adapt this path to meet our need. FeedSource.inc file was modified by setting the variable published_date which contains the creation date of the node. In the same file, change the function by adding the import_delay variable that specifies the time in seconds during which the import is done periodically : example for 24 hours, (import_delay = 86400 seconds). There is a condition to check the difference between the current timestamp and the date of publication is not less than the time_delay, before allowing the import. There is another filter on the id of the FeedsImporter concerned, then it can't affects other FeedsImporter which must import at all times(without timeout).

twistor’s picture

Issue summary: View changes
Status: Active » Closed (outdated)