Bugfix for RSS Aggregator using SQLite

Discussion corner for Developers of Serendipity.
Post Reply
Tscherno
Regular
Posts: 17
Joined: Wed Oct 19, 2005 1:13 pm
Contact:

Bugfix for RSS Aggregator using SQLite

Post by Tscherno »

Just installed my first S9Y Installation using SQLite3 as DB. Worked like a charm, till i installed the RSS-Aggregator-Plugin. Everything seems to work; you can add feeds but they do not show up. I checked that the entries are in the db correctly.

I found the problem on the select-side. In line 285 in the serendipity_event_aggregator.php the select is done without explicit table names in the order by clause:

$sql = "SELECT f.feedid, f.feedname, f.feedurl, f.htmlurl, fc.categoryid, f.last_update, f.charset, f.match_expression
FROM {$serendipity['dbPrefix']}aggregator_feeds AS f
LEFT OUTER JOIN {$serendipity['dbPrefix']}aggregator_feedcat AS fc
ON f.feedid = fc.feedid
ORDER BY feedname, feedid
";

That causes SQLite crying around:
SQL error: ambiguous column name: feedid

So i changed the select to this:
$sql = "SELECT f.feedid, f.feedname, f.feedurl, f.htmlurl, fc.categoryid, f.last_update, f.charset, f.match_expression
FROM {$serendipity['dbPrefix']}aggregator_feeds AS f
LEFT OUTER JOIN {$serendipity['dbPrefix']}aggregator_feedcat AS fc
ON f.feedid = fc.feedid
ORDER BY feedname, f.feedid
";

Now everything works fine.

PS: Isn't there a error handling for SQLite errors?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Bugfix for RSS Aggregator using SQLite

Post by garvinhicking »

Hi!

Many thanks for this bugfix, i just committed that!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply