Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I am trying to drop all items in a feed and then re-import all items again.

In a D5 site where this worked in my module I used:

function mymodule_cron(){
    aggregator_remove('1');
    aggregator_refresh(aggregator_get_feed('1'));
    aggregator_remove('2');
    aggregator_refresh(aggregator_get_feed('2'));
}

however this no longer works in D7, so I tried adapting it to:

function mymodule_cron(){
    aggregator_remove('1');
    aggregator_refresh(aggregator_load('1'));
    aggregator_remove('2');
    aggregator_refresh(aggregator_load('2'));
}

I appear to be parsing a feed object to the aggregator_remove function but when I run cron or even if I run the code via drush it doesn't remove existing feed items.

Has anyone got any insights into where I am going wrong here?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.