Commit b1210583 authored by Dries's avatar Dries

- Patch #971812 by mfb: aggregator should interpret Atom entry id as equivalent to RSS item guid.

parent 5f9eda19
......@@ -125,7 +125,11 @@ function aggregator_parse_feed(&$data, $feed) {
else {
$item['link'] = $feed->link;
}
$item['guid'] = isset($item['guid']) ? $item['guid'] : '';
// Atom feeds have an ID tag instead of a GUID tag.
if (!isset($item['guid'])) {
$item['guid'] = isset($item['id']) ? $item['id'] : '';
}
// Atom feeds have a content and/or summary tag instead of a description tag.
if (!empty($item['content:encoded'])) {
......
......@@ -854,6 +854,7 @@ class FeedParserTestCase extends AggregatorTestCase {
$this->assertText('Atom-Powered Robots Run Amok');
$this->assertLinkByHref('http://example.org/2003/12/13/atom03');
$this->assertText('Some text.');
$this->assertEqual('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a', db_query('SELECT guid FROM {aggregator_item} WHERE link = :link', array(':link' => 'http://example.org/2003/12/13/atom03'))->fetchField(), 'Atom entry id element is parsed correctly.');
}
}
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