Headline links do not get parsed in some ATOM feeds
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | aggregator.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (code 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.