summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/issues_controller.rb3
-rw-r--r--test/functional/issues_controller_test.rb19
2 files changed, 21 insertions, 1 deletions
diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb
index e1a3d860c..69a947b03 100644
--- a/app/controllers/issues_controller.rb
+++ b/app/controllers/issues_controller.rb
@@ -40,7 +40,8 @@ class IssuesController < ApplicationController
helper :timelog
def index
- retrieve_query
+ use_session = !request.format.csv?
+ retrieve_query(IssueQuery, use_session)
if @query.valid?
respond_to do |format|
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 872db7a1d..377ee1fb1 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -803,6 +803,25 @@ class IssuesControllerTest < Redmine::ControllerTest
end
end
+ def test_index_csv_should_not_change_selected_columns
+ get :index, :params => {
+ :set_filter => 1,
+ :c => ["subject", "due_date"],
+ :project_id => "ecookbook"
+ }
+ assert_response :success
+ assert_equal [:subject, :due_date], session[:issue_query][:column_names]
+
+ get :index, :params => {
+ :set_filter => 1,
+ :c =>["all_inline"],
+ :project_id => "ecookbook",
+ :format => 'csv'
+ }
+ assert_response :success
+ assert_equal [:subject, :due_date], session[:issue_query][:column_names]
+ end
+
def test_index_pdf
["en", "zh", "zh-TW", "ja", "ko"].each do |lang|
with_settings :default_language => lang do