diff options
Diffstat (limited to 'app/Models/EntryDAO.php')
| -rw-r--r-- | app/Models/EntryDAO.php | 18 |
1 files changed, 14 insertions, 4 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; + } } } } |
