aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-10-15 17:14:50 +0200
committerGravatar GitHub <noreply@github.com> 2024-10-15 17:14:50 +0200
commitf77b45656d8f8e2b367fb421f722c1f1f69a35c3 (patch)
tree5e552e4dbda8cadf3aee300072ed92bccd7c7faa /app
parentb552d9f4bc900462bb44fa4c1731a9443ec3e476 (diff)
Fix add feed with MariaDB / MySQL (#6900)
* Fix add feed with MariaDB / MySQL fix https://github.com/FreshRSS/FreshRSS/issues/6897 Regression from https://github.com/FreshRSS/FreshRSS/pull/4487 * Type fix
Diffstat (limited to 'app')
-rwxr-xr-xapp/Controllers/feedController.php4
-rw-r--r--app/Models/FeedDAO.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 48a829b10..d285d69f9 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -926,7 +926,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
FreshRSS_UserDAO::touch();
$feedDAO = FreshRSS_Factory::createFeedDao();
- return $feedDAO->updateFeed($feed_id, ['name' => $feed_name]) === 1;
+ return $feedDAO->updateFeed($feed_id, ['name' => $feed_name]);
}
public static function moveFeed(int $feed_id, int $cat_id, string $new_cat_name = ''): bool {
@@ -949,7 +949,7 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
$feedDAO = FreshRSS_Factory::createFeedDao();
- return $feedDAO->updateFeed($feed_id, ['category' => $cat_id]) === 1;
+ return $feedDAO->updateFeed($feed_id, ['category' => $cat_id]);
}
/**
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index e6bd34185..ea6e7fc55 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -140,7 +140,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
* @param array{'url'?:string,'kind'?:int,'category'?:int,'name'?:string,'website'?:string,'description'?:string,'lastUpdate'?:int,'priority'?:int,
* 'pathEntries'?:string,'httpAuth'?:string,'error'?:int,'ttl'?:int,'attributes'?:string|array<string,mixed>} $valuesTmp $valuesTmp
*/
- public function updateFeed(int $id, array $valuesTmp): int|false {
+ public function updateFeed(int $id, array $valuesTmp): bool {
$values = [];
$originalValues = $valuesTmp;
if (isset($valuesTmp['name'])) {
@@ -174,7 +174,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
$values[] = $id;
if ($stm !== false && $stm->execute($values)) {
- return $stm->rowCount();
+ return true;
} else {
$info = $stm === false ? $this->pdo->errorInfo() : $stm->errorInfo();
if ($this->autoUpdateDb($info)) {
@@ -189,7 +189,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
* @param non-empty-string $key
* @param string|array<mixed>|bool|int|null $value
*/
- public function updateFeedAttribute(FreshRSS_Feed $feed, string $key, $value): int|false {
+ public function updateFeedAttribute(FreshRSS_Feed $feed, string $key, $value): bool {
$feed->_attribute($key, $value);
return $this->updateFeed(
$feed->id(),