diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-01-12 23:20:33 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-01-12 23:20:33 +0000 |
commit | b121058392fd16ad316d30be79ae4b8baa5104b7 (patch) | |
tree | ecc2dff488ec99d9de8cf0afe76bbbc5010beaf4 /modules | |
parent | 5f9eda1973a4053f00464060ec274c08c8659254 (diff) | |
download | brdo-b121058392fd16ad316d30be79ae4b8baa5104b7.tar.gz brdo-b121058392fd16ad316d30be79ae4b8baa5104b7.tar.bz2 |
- Patch #971812 by mfb: aggregator should interpret Atom entry id as equivalent to RSS item guid.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator/aggregator.parser.inc | 6 | ||||
-rw-r--r-- | modules/aggregator/aggregator.test | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/modules/aggregator/aggregator.parser.inc b/modules/aggregator/aggregator.parser.inc index 4b1ff2053..259fc2021 100644 --- a/modules/aggregator/aggregator.parser.inc +++ b/modules/aggregator/aggregator.parser.inc @@ -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'])) { diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test index abe7804d5..a4764f868 100644 --- a/modules/aggregator/aggregator.test +++ b/modules/aggregator/aggregator.test @@ -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.'); } } |