]> source.dussan.org Git - redmine.git/commitdiff
Merged r17686 from trunk to 3.4-stable (#26785).
authorGo MAEDA <maeda@farend.jp>
Tue, 4 Dec 2018 10:04:36 +0000 (10:04 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 4 Dec 2018 10:04:36 +0000 (10:04 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17687 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/issues_controller.rb
test/functional/issues_controller_test.rb

index e1a3d860c08ac2acc1149ff017a49725fba24ca0..69a947b031afae8d0823bc5745abca1e543cb105 100644 (file)
@@ -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|
index 74f5e8ef5b6a7f50006c29d4db51cbebddea870d..4eb059056676e523ea3ad23ec5cf17b8acaf192c 100644 (file)
@@ -773,6 +773,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