Closed (fixed)
Project:
FeedAPI
Version:
6.x-1.x-dev
Component:
Code feedapi_node
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 May 2009 at 01:14 UTC
Updated:
1 Jul 2009 at 15:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
alex_b commentedConfirmed that feed is valid: http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fdrupal.org%2Ffil...
Looking at this now.
Comment #2
alex_b commentedI can't confirm this problem on a clean latest 6.x install of feedapi+common syndication parser: http://skitch.com/alexbarth/bqbsw/php.net-releases-localhost
I'm guessing there's some interaction with previous actions on the feed. May be already one node existed before refreshing?
Comment #3
edsko commentedFor what it's worth, I had the exact same problem: a refresh on the feed would download 1 of the entries in the feed and "update" the others, even though none of the items were yet in the database.
After a lot of debugging I realized that the UIDs from the feed were not consistent from one download of the feed to the next (the feed in question was http://www.kravmagaeu.com/index.php/en/upcoming-events?view=simplecalend... , generated I think by a Joomla module called "SimpleCalendar").
When I hacked feedapi_node.module to always return TRUE from _feedapi_node_unique all the nodes were properly added; of course, now when I refresh the feed I have make sure to delete all nodes first. Might be useful to add an option to ignore UIDs, always assumes that nodes are unique, but always delete nodes before refreshing (of course, this is doable for small streams only).
Comment #4
lyricnz commentedI just retested this:
- emptied database from existing D6 install, reinstall drupal
- current feedapi CVS
- parser_simplepie/simplepie.inc 1.1.3
- enable feedapi, feedapi_node, parser_simplepie
- create feed node with http://www.php.net/releases.atom and default options (see first attachment)
- click "refresh", issue is observed as reported! (second attachment)
- open /admin/content/node and observe two items of content (one is feed, one is content)
Comment #5
lyricnz commentedI just tried this yet again, with an utterly empty site (from scratch, empty filesystem and database). Same results as above. Attached is a complete log of my drupal installation, and new screenshots (same as above).
Notice, in particular, that only one of the two nodes has the "new" tag.
Next, I installed devel module (fourth attachment), so I can look at those created nodes more carefully. The new feed item looks fine (fifth attachment). Time to add some debugging to feedapi to figure out why it thinks it's updating an item...
Comment #6
lyricnz commentedAdding some debug output to _feedapi_invoke_refresh() shows that the feed looks basically okay, and it's processing both nodes, per first attachment. It's calling _feedapi_node_unique() to determine whether the items are distinct, and it thinks that they're the same! This appears to be because of:
When $feed_item->options->original_url is an empty string (as opposed to unset), like it is in this case, it will keep thinking nodes are duplicates.
So... the problem is really that the feed item original_url should not be set, rather than being empty. Or, this check should treat the two the same.
Comment #7
lyricnz commentedIt seems this was broken by this change which added html_entity_decode() to the output of simplepie. However html_entity_decode(NULL) ==> '', which is what's causing the problem downstream.
Suggest we change this to check for NULL first, see attached patch.
Comment #8
lyricnz commented(FWIW, my original report was confused by the two nodes - one of which was the _feed_ and one of which was the created+updated feed item)
Comment #9
aron novakIn #7, the patch looks good, does not break anything.
Which version of PHP? For me, NULL, simply returns an empty string:
Comment #10
lyricnz commentedThat's what I mean by '' - an empty string (which is what's breaking _feedapi_node_unique)
From #6: "When $feed_item->options->original_url is an empty string (as opposed to unset), like it is in this case, it will keep thinking nodes are duplicates."
Comment #11
aron novakThanks, commited.