fix update stopped by get_article_labels()

This commit is contained in:
Andrew Dolgov 2012-10-30 14:59:09 +04:00
parent 3fc6e71ac8
commit bb894b2990
2 changed files with 14 additions and 12 deletions

View File

@ -3868,18 +3868,19 @@
} }
} }
function get_article_labels($link, $id) { function get_article_labels($link, $id, $owner_uid = false) {
$rv = array(); $rv = array();
if (!$owner_uid) $owner_uid = $_SESSION["uid"];
$result = db_query($link, "SELECT label_cache FROM $result = db_query($link, "SELECT label_cache FROM
ttrss_user_entries WHERE ref_id = '$id' AND owner_uid = " . ttrss_user_entries WHERE ref_id = '$id' AND owner_uid = " .
$_SESSION["uid"]); $owner_uid);
if (db_num_rows($result) > 0) {
$label_cache = db_fetch_result($result, 0, "label_cache"); $label_cache = db_fetch_result($result, 0, "label_cache");
if ($label_cache) { if ($label_cache) {
$label_cache = json_decode($label_cache, true); $label_cache = json_decode($label_cache, true);
if ($label_cache["no-labels"] == 1) if ($label_cache["no-labels"] == 1)
@ -3887,13 +3888,14 @@
else else
return $label_cache; return $label_cache;
} }
}
$result = db_query($link, $result = db_query($link,
"SELECT DISTINCT label_id,caption,fg_color,bg_color "SELECT DISTINCT label_id,caption,fg_color,bg_color
FROM ttrss_labels2, ttrss_user_labels2 FROM ttrss_labels2, ttrss_user_labels2
WHERE id = label_id WHERE id = label_id
AND article_id = '$id' AND article_id = '$id'
AND owner_uid = ".$_SESSION["uid"] . " AND owner_uid = ". $owner_uid . "
ORDER BY caption"); ORDER BY caption");
while ($line = db_fetch_assoc($result)) { while ($line = db_fetch_assoc($result)) {

View File

@ -875,7 +875,7 @@
} }
} }
$article_labels = get_article_labels($link, $entry_ref_id); $article_labels = get_article_labels($link, $entry_ref_id, $owner_uid);
if (find_article_filter($article_filters, "filter")) { if (find_article_filter($article_filters, "filter")) {
db_query($link, "COMMIT"); // close transaction in progress db_query($link, "COMMIT"); // close transaction in progress