]> source.dussan.org Git - redmine.git/commitdiff
fixed #9398 RSS feed on custom reports not displaying subproject changes
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 20 Mar 2007 18:55:33 +0000 (18:55 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 20 Mar 2007 18:55:33 +0000 (18:55 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@358 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/feeds_controller.rb

index 20ae6f25442cd8fe820656c17f29471cdbe77e3c..659006c807129b7770551a8220fa10e81090e9be 100644 (file)
@@ -35,19 +35,17 @@ class FeedsController < ApplicationController
   
   # issue feeds
   def issues
-    conditions = nil
-    
-    if params[:query_id]
+    if @project && params[:query_id]
       query = Query.find(params[:query_id])
       # ignore query if it's not valid
       query = nil unless query.valid?
-      conditions = query.statement if query
+      # override with query conditions
+      @find_options[:conditions] = query.statement if query.valid? and @project == query.project
     end
 
     Issue.with_scope(:find => @find_options) do
       @issues = Issue.find :all, :include => [:project, :author, :tracker, :status], 
-                                 :order => "#{Issue.table_name}.created_on DESC",
-                                 :conditions => conditions
+                                 :order => "#{Issue.table_name}.created_on DESC"
     end
     @title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_reported_issues))
     headers["Content-Type"] = "application/rss+xml"
@@ -55,20 +53,18 @@ class FeedsController < ApplicationController
   end
   
   # issue changes feeds
-  def history
-    conditions = nil
-    
-    if params[:query_id]
+  def history    
+    if @project && params[:query_id]
       query = Query.find(params[:query_id])
       # ignore query if it's not valid
       query = nil unless query.valid?
-      conditions = query.statement if query
+      # override with query conditions
+      @find_options[:conditions] = query.statement if query.valid? and @project == query.project
     end
 
     Journal.with_scope(:find => @find_options) do
       @journals = Journal.find :all, :include => [ :details, :user, {:issue => [:project, :author, :tracker, :status]} ], 
-                                     :order => "#{Journal.table_name}.created_on DESC",
-                                     :conditions => conditions
+                                     :order => "#{Journal.table_name}.created_on DESC"
     end
     
     @title = (@project ? @project.name : Setting.app_title) + ": " + (query ? query.name : l(:label_reported_issues))