]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix: feed editor was broken if categories were disabled, bump version to p1
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 20 Sep 2006 16:23:32 +0000 (17:23 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 20 Sep 2006 16:23:32 +0000 (17:23 +0100)
backend.php
version.php

index 4e0dfccb799fbf283c83db5e3e1403469acc33b1..e4329a26c96f874213ea96b324ac1621b1217be7 100644 (file)
 
                        if (get_pref($link, 'ENABLE_FEED_CATS')) {                      
                                if ($cat_id && $cat_id != 0) {
-                                       $category_qpart = "cat_id = '$cat_id'";
+                                       $category_qpart = "cat_id = '$cat_id',";
+                                       $category_qpart_nocomma = "cat_id = '$cat_id'";
                                } else {
-                                       $category_qpart = 'cat_id = NULL';
+                                       $category_qpart = 'cat_id = NULL,';
+                                       $category_qpart_nocomma = 'cat_id = NULL';
                                }
                        } else {
                                $category_qpart = "";
+                               $category_qpart_nocomma = "";
                        }
 
                        if ($parent_feed && $parent_feed != 0) {
                        }
 
                        $result = db_query($link, "UPDATE ttrss_feeds SET 
-                               $category_qpart,
-                               $parent_qpart,
+                               $category_qpart $parent_qpart,
                                title = '$feed_title', feed_url = '$feed_link',
                                update_interval = '$upd_intl',
                                purge_interval = '$purge_intl',
                                include_in_digest = $include_in_digest
                                WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
 
-                       # update linked feed categories
-                       $result = db_query($link, "UPDATE ttrss_feeds SET
-                               $category_qpart WHERE parent_feed = '$feed_id' AND
-                               owner_uid = " . $_SESSION["uid"]);
+                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                               # update linked feed categories
+                               $result = db_query($link, "UPDATE ttrss_feeds SET
+                                       $category_qpart_nocomma WHERE parent_feed = '$feed_id' AND
+                                       owner_uid = " . $_SESSION["uid"]);
+                       }
                }
 
                if ($subop == "saveCat") {
index 6b44e21a54e5c2f5dfa5f6ff47ce9fca1eb524c2..efa3485f03a48bcfc5da34e91062bce88611bd83 100644 (file)
@@ -1,3 +1,3 @@
 <?php
-       define(VERSION, "1.2.3");
+       define('VERSION', "1.2.3-p1");
 ?>