When adding my facebook status feed to my personal site just now I realised that a coding oversight restricts the automatic blocks created for aggregated feeds to a minimum of 2 posts.
Now, for something like showing your facebook status on a Drupal site, you probably only want to show one item - that being your latest status update, not the last 2 or 5 etc... So, you'll need to go to 'modules/aggregator' and edit your copy of the aggregator.module file.
Look around line 269 for the following code - I've added a '1' to the array - this allows the aggregator blocks to offer you a display of just the most recent feed item.
Note: I found this issue with Drupal 5.1 - it may have been corrected since then...
$form['block'] = array('#type' => 'select', '#title' => t('Number of news items in block'), '#default_value' => $value, '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
return $form;
Comment | File | Size | Author |
---|---|---|---|
#17 | 189935-17.patch | 1.88 KB | dcam |
Comments
Comment #1
dafederIn 6.12 this has yet to be changed. There are several threads on this but no one has offered an answer as to why this is the way it is. Adding 1 to the array seems to have no side-effects, so why not do so? In 6.x look at line 312 of aggregator.module.
Comment #2
Nick Robillard CreditAttribution: Nick Robillard commentedYes! This really really really needs to be fixed. I can't think of any reason why there was no 1 in the first place. Patching isn't an option for me as Drupal core is updated too often. I'm tempted to mark this issue as critical - but i won't. :)
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedclosed as duplicate #1482292: Lowest number of news items selectable for display in block is 2. Why not 1?
Comment #14
SpokjeThe
aggregator
module has been removed from Core in10.0.x-dev
and now lives on as a contrib module.Issues in the Core queue about the
aggregator
module, like this one, have been moved to the contrib module queue.Comment #15
larowlanComment #16
larowlanComment #17
dcam CreditAttribution: dcam as a volunteer commentedI've been ignoring this simple issue because I want to do away with the block plugins in favor of a view. After that it won't be a problem anymore. But when I started working on the view today I realized that we'll need to leave the plugin in the module until version 3 is released for backward compatibility. That's because there may be instances of the blocks such as those in Layout Builder that can't be automatically replaced by an update function. So some sites may choose to continue using the plugin for a while. We may as well fix this for them.
Comment #18
larowlanI am of the opinion that we don't need to test this, its a trivial change and we're wasting cpu cycles/time on each PR testing it, but happy for it to stay if you feel otherwise
Comment #19
dcam CreditAttribution: dcam as a volunteer commentedI agree. I was just trying to be thorough. I'll remove it from the patch.
Comment #22
dcam CreditAttribution: dcam as a volunteer commentedThanks to everyone who worked on this!