fix: feed editor was broken if categories were disabled, bump version to p1

This commit is contained in:
Andrew Dolgov 2006-09-20 17:23:32 +01:00
parent a2787d0a1c
commit 8bde41c35f
2 changed files with 13 additions and 9 deletions

View File

@ -1430,12 +1430,15 @@
if (get_pref($link, 'ENABLE_FEED_CATS')) { if (get_pref($link, 'ENABLE_FEED_CATS')) {
if ($cat_id && $cat_id != 0) { 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 { } else {
$category_qpart = 'cat_id = NULL'; $category_qpart = 'cat_id = NULL,';
$category_qpart_nocomma = 'cat_id = NULL';
} }
} else { } else {
$category_qpart = ""; $category_qpart = "";
$category_qpart_nocomma = "";
} }
if ($parent_feed && $parent_feed != 0) { if ($parent_feed && $parent_feed != 0) {
@ -1445,8 +1448,7 @@
} }
$result = db_query($link, "UPDATE ttrss_feeds SET $result = db_query($link, "UPDATE ttrss_feeds SET
$category_qpart, $category_qpart $parent_qpart,
$parent_qpart,
title = '$feed_title', feed_url = '$feed_link', title = '$feed_title', feed_url = '$feed_link',
update_interval = '$upd_intl', update_interval = '$upd_intl',
purge_interval = '$purge_intl', purge_interval = '$purge_intl',
@ -1458,10 +1460,12 @@
include_in_digest = $include_in_digest include_in_digest = $include_in_digest
WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]); WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
# update linked feed categories if (get_pref($link, 'ENABLE_FEED_CATS')) {
$result = db_query($link, "UPDATE ttrss_feeds SET # update linked feed categories
$category_qpart WHERE parent_feed = '$feed_id' AND $result = db_query($link, "UPDATE ttrss_feeds SET
owner_uid = " . $_SESSION["uid"]); $category_qpart_nocomma WHERE parent_feed = '$feed_id' AND
owner_uid = " . $_SESSION["uid"]);
}
} }
if ($subop == "saveCat") { if ($subop == "saveCat") {

View File

@ -1,3 +1,3 @@
<?php <?php
define(VERSION, "1.2.3"); define('VERSION', "1.2.3-p1");
?> ?>