diff options
| author | 2024-05-12 17:10:43 +0200 | |
|---|---|---|
| committer | 2024-05-12 17:10:43 +0200 | |
| commit | e0cc121c7a556126b6c4968cb9efac47ee1382b5 (patch) | |
| tree | ecaa7902b64ea9788c450079b5777475dfd4ea33 /app/Models/FeedDAO.php | |
| parent | 0940025980f66ed5bcf55443d573e5dc89f7bcaa (diff) | |
Fix SQLite imports produced before FreshRSS 1.20.0 (#6450)
fix https://github.com/FreshRSS/FreshRSS/issues/6088
Diffstat (limited to 'app/Models/FeedDAO.php')
| -rw-r--r-- | app/Models/FeedDAO.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 417c59da1..c0b2e9e7a 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -304,13 +304,19 @@ SELECT id, url, kind, category, name, website, description, `lastUpdate`, FROM `_feed` SQL; $stm = $this->pdo->query($sql); - if ($stm === false) { - return; - } - while ($row = $stm->fetch(PDO::FETCH_ASSOC)) { - /** @var array{'id':int,'url':string,'kind':int,'category':int,'name':string,'website':string,'description':string,'lastUpdate':int,'priority'?:int, - * 'pathEntries'?:string,'httpAuth':string,'error':int|bool,'ttl'?:int,'attributes'?:string} $row */ - yield $row; + if ($stm !== false) { + while ($row = $stm->fetch(PDO::FETCH_ASSOC)) { + /** @var array{'id':int,'url':string,'kind':int,'category':int,'name':string,'website':string,'description':string,'lastUpdate':int,'priority'?:int, + * 'pathEntries'?:string,'httpAuth':string,'error':int|bool,'ttl'?:int,'attributes'?:string} $row */ + yield $row; + } + } else { + $info = $this->pdo->errorInfo(); + if ($this->autoUpdateDb($info)) { + yield from $this->selectAll(); + } else { + Minz_Log::error(__method__ . ' error: ' . json_encode($info)); + } } } |
