From e1527b5fdae1e10de156327a6393a3f6d84a8e49 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 11 Jun 2008 19:17:42 +0000 Subject: [PATCH] fixed: Syndicated content fills results with empty entries up to max headlines count --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/SyndicatedContent.pm | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f91af837d..40a38f3e6 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,6 +1,7 @@ 7.5.11 - fixed: email password recovery submit button effected by UI level - fixed: Creating a shortcut creates a version tag even with autocommit turned on + - fixed: Syndicated content fills results with empty entries up to max headlines count - fixed: userImport.pl overwrites settings when updating users - fixed: Collaboration RSS link in header doesn't indicate title - fixed: edit branch can't update URLs on most assets diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index 270a6245d..3fffa51e5 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -485,7 +485,9 @@ sub _create_interleaved_items { } @$items = sort { $b->{date} <=> $a->{date} } @$items; # limit to $maxHeadlines - @$items = @$items[0 .. ($maxHeadlines - 1)]; + if (@$items > $maxHeadlines) { + splice @$items, $maxHeadlines; + } } #-------------------------------------------------------------------