Headline links do not get parsed in some ATOM feeds

slimandslam - March 23, 2007 - 07:02
Project:Drupal
Version:7.x-dev
Component:aggregator.module
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs work
Description

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

slimandslam - March 23, 2007 - 07:11

Note: I have verified this bug in Drupal 4.7.6 and 5.1

#2

budda - March 23, 2007 - 09:53
Project:Aggregator Node» Drupal
Version:HEAD» 6.x-dev
Component:Code» aggregator.module

Wrong project?

#3

Boris Mann - April 6, 2007 - 23:23
Version:6.x-dev» 5.x-dev
Status:active» needs review

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

Zen - April 13, 2007 - 13:29
Status:needs review» needs work

Please provide your solution in patch form, preferably against HEAD / 6-dev.

#5

csevb10 - April 13, 2007 - 15:44
Version:5.x-dev» 6.x-dev
Assigned to:Anonymous» csevb10
Status:needs work» needs review

Patched against HEAD / 6-dev according to the post by slimandslam

AttachmentSizeStatusTest resultOperations
aggregator_atom.patch859 bytesIgnoredNoneNone

#6

catch - October 29, 2007 - 12:11

This still applies with offset. Small fix. I don't use aggregator.module so could do with review by someone who does.

#7

mustafau - August 15, 2008 - 12:05
Title:Headline Links do not get parsed in some ATOM feeds» Headline links do not get parsed in some ATOM feeds
Version:6.x-dev» 7.x-dev
Assigned to:csevb10» Anonymous
Status:needs review» reviewed & tested by the community

Re-rolling.

Aggregator tests are passing. Also did not break tests I have written for #72915: Move feed parser to includes/feed.inc

AttachmentSizeStatusTest resultOperations
aggregator_atom_fix.patch912 bytesIdlePassed: 7187 passes, 0 fails, 0 exceptionsView details | Re-test

#8

Dries - August 16, 2008 - 07:35
Status:reviewed & tested by the community» needs work

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

mustafau - August 16, 2008 - 14:31
Status:needs work» reviewed & tested by the community

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.

AttachmentSizeStatusTest resultOperations
feed_parser_atom_test.patch7.79 KBIdleFailed: 7257 passes, 3 fails, 4 exceptionsView details | Re-test

#10

Dries - August 17, 2008 - 10:01
Status:reviewed & tested by the community» needs work

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

mustafau - August 17, 2008 - 17:28

Sample feed links to example.com now.

AttachmentSizeStatusTest resultOperations
test-feed-parser-atom-11.patch5.13 KBIdleFailed: 7215 passes, 3 fails, 4 exceptionsView details | Re-test

#12

mustafau - August 31, 2008 - 15:57
Status:needs work» needs review

#13

mcd - October 6, 2008 - 03:03

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

Anonymous (not verified) - November 11, 2008 - 13:05
Status:needs review» needs work

The last submitted patch failed testing.

#15

naudefj - December 29, 2008 - 05:53

Subscribe - also an issue in Drupal 6.8.

#16

yogayak - December 29, 2008 - 23:21

subscribe... still an issue

#17

DanielTheViking - March 18, 2009 - 13:27

Subscribing.

#18

mustafau - August 30, 2009 - 22:01
Priority:normal» critical

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.

AttachmentSizeStatusTest resultOperations
aggregator_atom_fix-18.patch18.18 KBIgnoredNoneNone

#19

shark - October 13, 2009 - 07:25

subscribing

 
 

Drupal is a registered trademark of Dries Buytaert.