From: Jean-Philippe Lang Date: Tue, 20 Mar 2007 18:55:33 +0000 (+0000) Subject: fixed #9398 RSS feed on custom reports not displaying subproject changes X-Git-Tag: 0.5.0~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8bf5759d26946f8641ba35d827b2e74616a88bbf;p=redmine.git fixed #9398 RSS feed on custom reports not displaying subproject changes git-svn-id: http://redmine.rubyforge.org/svn/trunk@358 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/feeds_controller.rb b/app/controllers/feeds_controller.rb index 20ae6f254..659006c80 100644 --- a/app/controllers/feeds_controller.rb +++ b/app/controllers/feeds_controller.rb @@ -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))