SQL error on unread archived posts

Development-related discussion, including bundled plugins
User avatar
Bear Rating Trainee
Bear Rating Trainee
Posts: 1
Joined: 09 Oct 2010, 01:22

SQL error on unread archived posts

Postby dc55028 » 09 Oct 2010, 01:27


I've used Tiny Tiny RSS for some time, and found that if an unread article is archived, there is an SQL error, because feed ID is null for archived articles.

I have this fix, on my server :

Code: Select all

diff --git a/functions.php b/functions.php
index cdbfa4c..82714a2 100644
--- a/functions.php
+++ b/functions.php
@@ -5520,7 +5520,7 @@
                                $tmp_result = db_query($link, "SELECT always_display_enclosures FROM
-                                       ttrss_feeds WHERE id = ".$line['feed_id']." AND owner_uid = ".$_SESSION["uid"]);
+                                       ttrss_feeds WHERE id = ".(($line['feed_id']==null)?$line['orig_feed_id']:$line['feed_id'])." AND owner_uid = ".$_SESSION["uid"]);
                                $always_display_enclosures = db_fetch_result($tmp_result, 0, "always_display_enclosures");

I would have sent this to GitHub, but I haven't found how, yet.

I use a mySQL database.

User avatar
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia

Re: SQL error on unread archived posts

Postby fox » 11 Oct 2010, 11:25

Thanks, fixed in trunk.

Return to “Development”

Who is online

Users browsing this forum: No registered users and 3 guests