Fix for ticket #1131. If the rss feed is for an item, then retrieve the item. Using the left and right pointers find all the comments for the child items. Thanks to jankoprowski for the initial investigation.

This commit is contained in:
Tim Almdal
2010-06-16 08:39:09 -07:00
parent 1fb3339326
commit ea8653f947

View File

@@ -33,13 +33,20 @@ class comment_rss_Core {
return;
}
Kohana_Log::add("error", "feed($feed_id, $offset, $limit, $id)");
$comments = ORM::factory("comment")
->viewable()
->where("state", "=", "published")
->order_by("created", "DESC");
if ($feed_id == "item") {
$comments->where("item_id", "=", $id);
$item = ORM::factory("item", $id);
$subquery = db::select("id")
->from("items")
->where("left_ptr", ">=", $item->left_ptr)
->where("right_ptr", "<=", $item->right_ptr);
$comments
->where("item_id", "in", $subquery);
}
$feed = new stdClass();