From 8bde41c35f8677a8680a1b183c8c780fd793dc89 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 20 Sep 2006 17:23:32 +0100 Subject: [PATCH] fix: feed editor was broken if categories were disabled, bump version to p1 --- backend.php | 20 ++++++++++++-------- version.php | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/backend.php b/backend.php index 4e0dfccb7..e4329a26c 100644 --- a/backend.php +++ b/backend.php @@ -1430,12 +1430,15 @@ 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) { @@ -1445,8 +1448,7 @@ } $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', @@ -1458,10 +1460,12 @@ 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") { diff --git a/version.php b/version.php index 6b44e21a5..efa3485f0 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@