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

merge-requests/26/head
Dries Buytaert 2011-01-12 23:20:33 +00:00
parent 5f9eda1973
commit b121058392
2 changed files with 6 additions and 1 deletions

View File

@ -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'])) {

View File

@ -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.');
}
}