Browse Source

Fix category not change (updating feed on MySQL)

See https://github.com/marienfressinaud/FreshRSS/issues/646
Marien Fressinaud 11 years ago
parent
commit
dd945df0cb
1 changed files with 4 additions and 2 deletions
  1. 4 2
      app/Controllers/feedController.php

+ 4 - 2
app/Controllers/feedController.php

@@ -384,12 +384,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 			$cat_id = Minz_Request::param('c_id');
 
 			$feedDAO = FreshRSS_Factory::createFeedDao();
-
 			$values = array(
 				'category' => $cat_id,
 			);
 
-			if (!$feedDAO->updateFeed($feed_id, $values)) {
+			$feed = $feedDAO->searchById($feed_id);
+
+			if (!$feed || ($feed->category() != $cat_id &&
+			               !$feedDAO->updateFeed($feed_id, $values))) {
 				Minz_Error::error(
 					404,
 					array('error' => array(_t('error_occurred')))