I'm trying to use the Aggregator to create a block of eight items from an infrequently updated feed. The problem is that only two of them are newer than 16 weeks, which is the fixed upper limit for how long Drupal will not discard the items. By the time some new items appear, probably some of the existing ones will be older than 16 weeks, and get discarded. I'm stuck with this lame, underpopulated block.

The 16-week limit strikes me as arbitrary, and it's in a core module that users are encouraged not to hack. If we're worried about people accidentally importing a zillion RSS items, make the *default* 2 weeks or something, but please make the option to hold on to more data available.

Comments

ultimateboy’s picture

Version: 6.8 » 7.x-dev

New features are only applied to dev.

alex_b’s picture

Status: Active » Closed (duplicate)
dsgirard’s picture

for those who don't mind hacking core, add values of your choice to this line (~ line 56) of aggregator.admin.inc:

$period = drupal_map_assoc(array(900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400), 'format_interval');
amanfree’s picture

even on doing as u said the matter is not resolved dear.

amanfree’s picture

please do at line 225 instead of 57 no line as suggested above by my fellow friend

pfahlr’s picture

I have a hack for this that doesn't require core modifications. Edit "aggregator_clear" in the variable table, set to whatever you like. However, every time you edit the aggregator settings, you'll need to manually update the variable table.

There should definitely be an "unlimited" option. Sure it may be logical to think that syndicated content should fall off after it's out of date, but in the real world there are clients, and sometimes their demands are illogical.

flaviovs’s picture

In the meantime, while the fix is not in core and you want to avoid hacking the sources, you can use a small module that do the trick of allowing feed items to exist "forever". Just create a small module (I called mine "Unlimit Aggregator" -- unagg) and put the following code on it:

function unagg_form_aggregator_admin_settings_alter(&$form)
{
     $form['aggregator_clear']['#options']['2147483647'] = t('1 trillion weeks');
}

Now you'll be able to select a very long time for expiration of your RSS items.

p.s.: There's a bug in the code above. Maybe 2,147,483,647 seconds is not exactly 1 trillion weeks, but you got the point. Figuring out the exact number of weeks and fixing the code is left as an exercise to the reader.