Jake Bunce
Well-known member
What is the purpose of this code?
XenForo_Model_Feed::_insertFeedEntry
Why would you update on duplicate when the purpose of xf_feed_log is to prevent duplicate rss posts? At this point in the execution the dupe checker has already run so there shouldn't be any duplicate insertions. I think the entire transaction should be rolled back at this point.
_____
I ask because of this guy's problem:
http://xenforo.com/community/threads/registered-feeds-posting-duplicates.19678/
It turns out the feed did not have a unique guid for all items. Granted, this is a problem with the feed itself. But the guid problem was causing the dupe checker to miss some items which were then allowed to be inserted by the above code. I found myself wondering why you would ever want to allow a duplicate insertion here.
XenForo_Model_Feed::_insertFeedEntry
Rich (BB code):
if ($writer->get('thread_id'))
{
$db->query('
INSERT INTO xf_feed_log
(feed_id, unique_id, hash, thread_id)
VALUES
(?, ?, ?, ?)
ON DUPLICATE KEY UPDATE
hash = VALUES(hash),
thread_id = VALUES(thread_id)
', array($feed['feed_id'], utf8_substr($entryData['id'], 0, 250), $entryData['hash'], $writer->get('thread_id')));
}
Why would you update on duplicate when the purpose of xf_feed_log is to prevent duplicate rss posts? At this point in the execution the dupe checker has already run so there shouldn't be any duplicate insertions. I think the entire transaction should be rolled back at this point.
_____
I ask because of this guy's problem:
http://xenforo.com/community/threads/registered-feeds-posting-duplicates.19678/
It turns out the feed did not have a unique guid for all items. Granted, this is a problem with the feed itself. But the guid problem was causing the dupe checker to miss some items which were then allowed to be inserted by the above code. I found myself wondering why you would ever want to allow a duplicate insertion here.