aboutsummaryrefslogtreecommitdiff
path: root/p/api/greader.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre.alapetite@alexandra.dk> 2016-09-26 15:20:02 +0200
committerGravatar Alexandre Alapetite <alexandre.alapetite@alexandra.dk> 2016-09-26 15:20:02 +0200
commitd5ca360ca967d327a184429a2e37aed196add7a0 (patch)
tree7c658a7ae04e32854703030b4ddcd77f90becdfb /p/api/greader.php
parent273d28b763d4eaf32a250e8c002e3775eb2513e9 (diff)
API fix feed rename
https://github.com/FreshRSS/FreshRSS/issues/1254 https://github.com/jangernert/FeedReader/issues/59#issuecomment-249558202
Diffstat (limited to 'p/api/greader.php')
-rw-r--r--p/api/greader.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/p/api/greader.php b/p/api/greader.php
index 8b1e0ffb1..4965ffd3b 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -323,13 +323,10 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '
}
}
$cat = $categoryDAO->searchByName($c_name);
- $addCatId = $cat == null ? -1 : $cat->id();
+ $addCatId = $cat == null ? 0 : $cat->id();
} else if ($remove != '' && strpos($remove, 'user/-/label/')) {
$addCatId = 1; //Default category
}
- if ($addCatId <= 0 && $c_name == '') {
- $addCatId = 1; //Default category
- }
$feedDAO = FreshRSS_Factory::createFeedDao();
for ($i = count($streamNames) - 1; $i >= 0; $i--) {
$streamName = $streamNames[$i]; //feed/http://example.net/sample.xml ; feed/338
@@ -366,7 +363,9 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '
break;
case 'edit':
if ($feedId > 0) {
- FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name);
+ if ($addCatId > 0 || $c_name != '') {
+ FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name);
+ }
if ($title != '') {
FreshRSS_feed_Controller::renameFeed($feedId, $title);
}