summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-06-16 08:39:09 -0700
committerTim Almdal <tnalmdal@shaw.ca>2010-06-16 08:39:09 -0700
commitea8653f9470ceb09a4d5ddca2aec023f2f7fe5a2 (patch)
treee2a5c7da338d646f0d241fa70a8ff31d9b505ac2
parent1fb33393269d3a1d32048898545c5ef812383f2e (diff)
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.
-rw-r--r--modules/comment/helpers/comment_rss.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php
index eee6f750..a18beb9b 100644
--- a/modules/comment/helpers/comment_rss.php
+++ b/modules/comment/helpers/comment_rss.php
@@ -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();