]> git.wh0rd.org Git - tt-rss.git/commitdiff
properly initialize archived_feed info when removing feed
authorAndrew Dolgov <fox@bah.org.ru>
Mon, 28 Dec 2009 16:34:05 +0000 (19:34 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Mon, 28 Dec 2009 16:34:05 +0000 (19:34 +0300)
functions.php

index e8682ca3746e6f06c18db83bd0019bc1ac6544cd..de35b327420175b0948e8e5d7abc5d91c6aa6d00 100644 (file)
 
                        db_query($link, "BEGIN");
 
+                       /* prepare feed if necessary */
+
+                       $result = db_query($link, "SELECT id FROM ttrss_archived_feeds
+                               WHERE id = '$id'");
+
+                       if (db_num_rows($result) == 0) {
+                               db_query($link, "INSERT INTO ttrss_archived_feeds 
+                                       (id, owner_uid, title, feed_url, site_url)
+                               SELECT id, owner_uid, title, feed_url, site_url from ttrss_feeds
+                               WHERE id = '$id'");
+                       }
+
                        db_query($link, "UPDATE ttrss_user_entries SET feed_id = NULL 
                                WHERE feed_id = '$id' AND 
                                        marked = true AND owner_uid = $owner_uid");