aboutsummaryrefslogtreecommitdiff
path: root/app/Models/CategoryDAO.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-11-06 21:54:13 +0100
committerGravatar GitHub <noreply@github.com> 2019-11-06 21:54:13 +0100
commit91cb165829badde07c42a002215cf52779d891b6 (patch)
treeb8ee6e04e32dcf6c6fc25b7b0b9fe2952d2991ba /app/Models/CategoryDAO.php
parent3aa66f317b496ccd9a2df914bbc747c52081a7ad (diff)
parent6d596e9e54308297d423b23bf65338d62eebc415 (diff)
Merge pull request #2633 from FreshRSS/dev1.15.1
FreshRSS 1.15.1
Diffstat (limited to 'app/Models/CategoryDAO.php')
-rw-r--r--app/Models/CategoryDAO.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index c1277751c..08dc4eef0 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -4,6 +4,16 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable
const DEFAULTCATEGORYID = 1;
+ public function resetDefaultCategoryName() {
+ //FreshRSS 1.15.1
+ $stm = $this->pdo->prepare('UPDATE `_category` SET name = :name WHERE id = :id');
+ if ($stm) {
+ $stm->bindValue(':id', self::DEFAULTCATEGORYID, PDO::PARAM_INT);
+ $stm->bindValue(':name', 'Uncategorized');
+ }
+ return $stm && $stm->execute();
+ }
+
protected function addColumn($name) {
Minz_Log::warning(__method__ . ': ' . $name);
try {
@@ -45,6 +55,9 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable
} else {
$this->pdo->exec('DROP INDEX IF EXISTS feed_keep_history_index'); //SQLite at least drop index
}
+
+ $this->resetDefaultCategoryName();
+
return $ok;
}
} catch (Exception $e) {