Headline links do not get parsed in some ATOM feeds
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | aggregator.module |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs work |
Use any Blogger ATOM feed. Here's a random one:
http://www.librarything.com/thingology/atom.xml
Add it to Aggregator. Create a block. Roll your mouse over the headlines in the block.
You'll see that the links are all the same. That's a bug in Aggregator. The problem
happens because when aggregator parses the "CONTENT" tag, it sets $element=''
That happens in the parser routine aggregator_element_end();
The fix:
1) Remove this line from the function aggregator_element_end()
case 'CONTENT':
2) In the function aggregator_element_start() remove this line:
case 'CONTENT':
and then add it back in near the bottom of the switch statement like this:
case 'CONTENT':
if ($element != 'ITEM') {
$element = $name;
}
break;

#1
Note: I have verified this bug in Drupal 4.7.6 and 5.1
#2
Wrong project?
#3
This seems to have correctly identified the issue and fix for Atom feeds (aka Blogspot in many cases). Setting to 5.x as bug fix, need a patch rolled.
#4
Please provide your solution in patch form, preferably against HEAD / 6-dev.
#5
Patched against HEAD / 6-dev according to the post by slimandslam
#6
This still applies with offset. Small fix. I don't use aggregator.module so could do with review by someone who does.
#7
Re-rolling.
Aggregator tests are passing. Also did not break tests I have written for #72915: Move feed parser to includes/feed.inc
#8
Would be great to have a test case for Atom feeds that illustrate this bug. With a test case, this patch will go in with the blink of an eye.
#9
A test case is attached.
I have created more tests than this however some of my tests are failing. I will open another issue after this issue is fixed.
#10
I think this looks good, but I'd prefer to trim down the feed and to make it link to example.com, etc. I'm not sure it is a good idea to include that feed "as is". Let's clean it up a little so it is actually a fake feed but with the same features. Almost there ...
#11
Sample feed links to example.com now.
#12
#13
I tried the patch against drupal 5.10, and while it worked for the blogspot feed that was giving me issues, I later added a new blogspot feed which is currently duplicating link targets as described:
http://walterjonwilliams.blogspot.com/feeds/posts/default
#14
The last submitted patch failed testing.
#15
Subscribe - also an issue in Drupal 6.8.
#16
subscribe... still an issue
#17
Subscribing.
#18
Feed parser is seriously broken. Attached patch has a number of tests to show those broken areas. I do not know how to fix this.
* image tag in RSS 0.91 is not being parsed.
* items from RSS 2.0 are not being parsed.
* Atom feeds are not being parsed at all.
* Every resulting item from an atom feed has $item['entry'] as an offset.
* $feed->items had actual + 1 number of items.
#19
subscribing