Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
General question. In D6 FeedAPI I recall that the cron would import feed items for the parent feed even if it was unpublished. Is this the case with Feeds? Are there settings that need to be set?
If it does, is this the code to adjust to check if importer is published? Please advise on how to adjust it (sorry for my lack of programming skills in advance).
function feeds_cron() {
if ($importers = feeds_reschedule()) {
foreach ($importers as $id) {
feeds_importer($id)->schedule();
$rows = db_query("SELECT feed_nid FROM {feeds_source} WHERE id = :id", array(':id' => $id));
foreach ($rows as $row) {
feeds_source($id, $row->feed_nid)->schedule();
}
}
feeds_reschedule(FALSE);
Comment | File | Size | Author |
---|---|---|---|
#4 | feeds-skip-unpublished-nodes-1195484-4.patch | 672 bytes | steven.wichers |
Comments
Comment #1
hellomobe CreditAttribution: hellomobe commentedI don't have my cron set up yet to test this, but here is my change - feedback welcome.
Comment #2
hellomobe CreditAttribution: hellomobe commentedThis isn't working. When I clear the cache it still runs the unpublished feeds. (I really don't understand why it's running when the cache is cleared).
Comment #3
twistor CreditAttribution: twistor commentedThis is doable, but it would have to be done in a backwards-compatible, and configurable way.
Comment #4
steven.wichers CreditAttribution: steven.wichers commentedHere's a patch for #1. I haven't tested if it actually works beyond comparing the result of a count() with and without restricting by node status (there was a difference).
Comment #5
liquidcms CreditAttribution: liquidcms commentedfirst test seems to show that patch in #4 does NOT work. will test more tomorrow.
Comment #6
tyler-durden CreditAttribution: tyler-durden commentedI'm not a programmer so I can't help, but as a user I'd think there should be a way to control the feed of each individual importer. Right now your only option is to delete it to stop it feeding, unless I am missing something. I need this individual control, and unpublishing it to turn it off would make logical sense.
Did this get anywhere? Last post mentions looking into why it didn't work tomorrow, but "tomorrow" was over 19 weeks ago.
Comment #7
jadhavdevendra CreditAttribution: jadhavdevendra as a volunteer commented#4 does not work. Is anyone working on this?
Comment #8
jadhavdevendra CreditAttribution: jadhavdevendra as a volunteer commentedCurrent workaround & assumptions -