A free, self-hostable news aggregator…
Bug "mark all as read" when using DESC and pagination and no scroll
Alexandre Alapetite7313f9f3a306
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.phpindex aaf4dcf6a..f41d6c560 100644--- a/app/Models/EntryDAO.php+++ b/app/Models/EntryDAO.php@@ -65,7 +65,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {}}public function markReadEntries ($idMax = 0, $favorites = false) {- if ($idMax === 0) {+ if ($idMax == 0) {$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '. 'SET e.is_read = 1, f.cache_nbUnreads=0 '. 'WHERE e.is_read = 0 AND ';@@ -127,7 +127,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {}}public function markReadCat ($id, $idMax = 0) {- if ($idMax === 0) {+ if ($idMax == 0) {$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '. 'SET e.is_read = 1, f.cache_nbUnreads=0 '. 'WHERE f.category = ? AND e.is_read = 0';@@ -182,7 +182,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {}}public function markReadFeed ($id, $idMax = 0) {- if ($idMax === 0) {+ if ($idMax == 0) {$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed = f.id '. 'SET e.is_read = 1, f.cache_nbUnreads=0 '. 'WHERE f.id=? AND e.is_read = 0';diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtmlindex 24c0e38e9..097809e08 100644--- a/app/layout/nav_menu.phtml+++ b/app/layout/nav_menu.phtml@@ -62,12 +62,11 @@}}if ($this->order === 'ASC') {- $nb = count($this->entries) - 1;- $p = ($nb >= 0 && isset($this->entries[$nb])) ? $this->entries[$nb] : null;+ $idMax = 0;} else {$p = isset($this->entries[0]) ? $this->entries[0] : null;+ $idMax = $p === null ? '0' : $p->id();}- $idMax = $p === null ? '0' : $p->id();$arUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('get' => $get, 'nextGet' => $nextGet, 'idMax' => $idMax));$output = Minz_Request::param('output', '');