summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-12-25 11:31:07 +0100
committerGravatar GitHub <noreply@github.com> 2025-12-25 11:31:07 +0100
commit6fb5263633ce318432cf3d177539cbd574e0fce2 (patch)
tree341836207557045d62f7b1d51270b1d227728fc7 /app
parentae2ab45266d7d580879755ac94fc0cbc0ffb4732 (diff)
DB: auto-add lastUserModified column also during markRead (#8346)
fix https://github.com/FreshRSS/FreshRSS/issues/8345
Diffstat (limited to 'app')
-rw-r--r--app/Models/EntryDAO.php18
-rw-r--r--app/Models/EntryDAOSQLite.php11
2 files changed, 22 insertions, 7 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index eb800ff1e..6017fb413 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -491,8 +491,13 @@ SQL;
$stm = $this->pdo->prepare($sql);
if ($stm === false || !$stm->execute($values)) {
$info = $stm === false ? $this->pdo->errorInfo() : $stm->errorInfo();
- Minz_Log::error('SQL error ' . __METHOD__ . ' A ' . json_encode($info));
- return false;
+ /** @var array{0:string,1:int,2:string} $info */
+ if ($this->autoUpdateDb($info)) {
+ return $this->markRead($ids, $is_read);
+ } else {
+ Minz_Log::error('SQL error ' . __METHOD__ . ' A ' . json_encode($info));
+ return false;
+ }
}
$affected = $stm->rowCount();
if (($affected > 0) && (!$this->updateCacheUnreads(null, null))) {
@@ -511,8 +516,13 @@ SQL;
return $stm->rowCount();
} else {
$info = $stm === false ? $this->pdo->errorInfo() : $stm->errorInfo();
- Minz_Log::error('SQL error ' . __METHOD__ . ' B ' . json_encode($info));
- return false;
+ /** @var array{0:string,1:int,2:string} $info */
+ if ($this->autoUpdateDb($info)) {
+ return $this->markRead($ids, $is_read);
+ } else {
+ Minz_Log::error('SQL error ' . __METHOD__ . ' B ' . json_encode($info));
+ return false;
+ }
}
}
}
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 4ae4d3579..daccc66d4 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -134,9 +134,14 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->pdo->prepare($sql);
if ($stm === false || !$stm->execute($values)) {
$info = $stm === false ? $this->pdo->errorInfo() : $stm->errorInfo();
- Minz_Log::error('SQL error ' . __METHOD__ . ' A ' . json_encode($info));
- $this->pdo->rollBack();
- return false;
+ /** @var array{0:string,1:int,2:string} $info */
+ if ($this->autoUpdateDb($info)) {
+ return $this->markRead($ids, $is_read);
+ } else {
+ Minz_Log::error('SQL error ' . __METHOD__ . ' A ' . json_encode($info));
+ $this->pdo->rollBack();
+ return false;
+ }
}
$affected = $stm->rowCount();
if ($affected > 0) {