Commit 134cfbe4 authored by alexpott's avatar alexpott

Issue #2187233 by eelkeblok: Aggregator fails when a feed item contains an empty description.

parent 12953f2e
......@@ -169,8 +169,14 @@ public function process(Feed $feed) {
$entry->setFeedId($feed->id());
$entry->setLink($item['link']);
$entry->setDescription($item['description']);
$entry->setGuid($item['guid']);
$description = '';
if (!empty($item['description'])) {
$description = $item['description'];
}
$entry->setDescription($description);
$entry->save();
}
}
......
......@@ -38,10 +38,11 @@ function testRemoveFeedItem() {
$feed = $this->createFeed($feed_url);
// Update and remove items two times in a row to make sure that removal
// resets all 'modified' information (modified, etag, hash) and allows for
// immediate update.
$this->updateAndRemove($feed, 4);
$this->updateAndRemove($feed, 4);
$this->updateAndRemove($feed, 4);
// immediate update. There's 8 items in the feed, but one has an empty
// title and is skipped.
$this->updateAndRemove($feed, 7);
$this->updateAndRemove($feed, 7);
$this->updateAndRemove($feed, 7);
// Delete feed.
$this->deleteFeed($feed);
}
......
......@@ -37,5 +37,26 @@
<author>I wanted to get out and walk eastward toward the park through the soft twilight, but each time I tried to go I became entangled in some wild, strident argument which pulled me back, as if with ropes, into my chair. Yet high over the city our line of yellow windows must have contributed their share of human secrecy to the casual watcher in the darkening streets, and I was him too, looking up and wondering. I was within and without, simultaneously enchanted and repelled by the inexhaustible variety of life.</author>
<description>Long author feed item description.</description>
</item>
<item>
<title></title>
<link>http://example.com/empty/title</link>
<description>This is an item with an empty title.</description>
</item>
<item>
<title>Empty description feed item title.</title>
<link>http://example.com/empty/description</link>
<description></description>
</item>
<item>
<title>Empty link feed item title.</title>
<link></link>
<description>This is an item with an empty link.</description>
</item>
<item>
<title>Empty author feed item title.</title>
<link>http://example.com/empty/author</link>
<author></author>
<description>We've tested items with no author, but what about an empty author tag?</description>
</item>
</channel>
</rss>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment