A free, self-hostable news aggregator…
fix depending results after changing value of "entry->isRead" (#4331)
Clemens Neubauer046598e743ac
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.phpindex cd4039470..758f39c88 100755--- a/app/Controllers/feedController.php+++ b/app/Controllers/feedController.php@@ -432,11 +432,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {} else { //This entry already exists but has been updated//Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->url(false) .//', old hash ' . $existingHash . ', new hash ' . $entry->hash());- $needFeedCacheRefresh = $mark_updated_article_unread;$entry->_isRead($mark_updated_article_unread ? false : null); //Change is_read according to policy.- if ($mark_updated_article_unread) {- $feed->incPendingUnread(); //Maybe- }$entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry);if ($entry === null) {@@ -444,6 +440,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {continue;}+ if (!$entry->isRead()) {+ $needFeedCacheRefresh = true;+ $feed->incPendingUnread(); //Maybe+ }+// If the entry has changed, there is a good chance for the full content to have changed as well.$entry->loadCompleteContent(true);@@ -480,7 +481,10 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {$entryDAO->beginTransaction();}$entryDAO->addEntry($entry->toArray());- $feed->incPendingUnread();++ if (!$entry->isRead()) {+ $feed->incPendingUnread();+ }$nb_new_articles++;}}