I found that an aggregator module doens't update a newer feed item. I chased the aggregator.module source code and found out the issue; I believe it seems to be a kind of bug, however, please correct me if I am wrong.
On the line 953 in a function aggregator_save_item, the SQL statement is:
db_query("UPDATE {aggregator_item} SET title = '%s', link = '%s', author = '%s', description = '%s', guid = '%s', timestamp = %d WHERE iid = %d", $edit['title'], $edit['link'], $edit['author'], $edit['description'], $edit['iid'], $edit['timestamp'], $edit['gid']);
However, it should be:
db_query("UPDATE {aggregator_item} SET title = '%s', link = '%s', author = '%s', description = '%s', guid = '%s', timestamp = %d WHERE iid = %d", $edit['title'], $edit['link'], $edit['author'], $edit['description'], $edit['guid'], $edit['timestamp'], $edit['iid']);
The position in `iid` and `guid` seems to be wrong, and there would be a misspelling of `guid`.
Comments
Comment #1
yasI am sorry that I found that this post is misplaced. Please delete this issue.
Thanks
--- yas
Comment #2
RobRoy commentedRecategorized issue to the right spot.
Comment #3
yasThanks, RobRoy
--- yas
Comment #4
yasI created the patch for fixing the function aggregator_save_item and let me submit it.
--- yas
Comment #5
asimmonds commentedRe-rolled for HEAD and tested, appears to fix the problem.
Should be fixed in 6.x-dev first then backported to 5.x-dev
Comment #6
gábor hojtsySeems to be a quite logical fix, committed to Drupal 6.x-dev. Needs to be backported to Drupal 5.x.
Comment #7
asimmonds commentedPatch applied to 5.x-dev with fuzz, but have re-rolled for 5.x-dev
Comment #8
drummCommitted to 5.x.
Comment #9
(not verified) commentedComment #10
kmartino commentedBug number #107023 (http://drupal.org/node/107023) fixed a bug related to updating previously saved aggregator items.
This update revealed a new bug that is only apparent when feeds are updated containing previously saved items - the timestamp in the feed is not respected and the timestamp being saved is the timestamp generated during the update operation.
Doing this eliminates a very important piece of metadata from the saved aggregator_item, making sorting, finding posts by their date, etc, impossible.
Steps to repeat - update a feed.
Comment #11
mustafau commented#52015: Updated timestamps for feed items
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.