RSS2.0 feed items not being created
| Project: | FeedAPI |
| Version: | 5.x-1.5 |
| Component: | Code parser_common |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Hi, I've had some trouble lately with FeedAPI and RSS2.0 feeds. In particular, I am able to create the Feed but no items are being retrieved. When I refresh the feed it says:
0 new item(s) were saved. 1 existing item(s) were updated.
although no items exist for the feed. This feed specifically does not contain a guid element, only a link element. After stepping through the code, I believe a line fails when it should succeed. On line 598, this checked is performed:
if (!empty($news['link'])) {
$original_url = "{$news['link']}";
}
else {
$original_url = NULL;
}
$news['link'] is a SimpleXMLElement and passing it into the empty function returns true even though it does have a link. This causes original_url to be null, along with guid (I mentioned the feed does not contain a guid). When the item is tested for uniqueness, it returns false (because link and guid are both null).
For a temporary fix, I've changed the above to:
if ( isset($news['link']) )
The items are created successfully. I'm not sure if the empty test was used for another reason because all the above test use isset.
Thanks

#1
Generally I do not maintain FeedAPI for Drupal 5.x, but your bug can be interesting, cause the same parser code is in the latest FeedAPI.
Can you share here the feed URL that you use? I hope it's public, and i can test what's going wrong here.
#2
Unfortunately, the feed is not public. But, I've created a dummy feed that mimics what the feed looks like:
<?xml version="1.0" encoding="ISO-8859-1"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xml:lang="en-US" version="2.0">
<channel>
<link>http://www.example.com</link>
<language>en-us</language>
<copyright>© Copyright 2007</copyright>
<title>Example.net</title>
<category>Newspapers</category>
<description>Headlines from Example.com</description>
<item>
<title><![CDATA[Some Title Goes Here]]></title>
<link><![CDATA[http://www.example.com/some-unique-link]]></link>
<pubDate><![CDATA[Fri, 13 Nov 2009 06:00:00 EST]]></pubDate>
<author><![CDATA[]]></author>
<description>
<![CDATA[]]>
<![CDATA[Some description here]]>
</description>
</item>
</channel>
</rss>
#3
Aron, any update on this?