diff options
author | Go MAEDA <maeda@farend.jp> | 2018-12-04 09:23:18 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-12-04 09:23:18 +0000 |
commit | c9cf695ad7631813771e6107c1a373db9727a632 (patch) | |
tree | 78fa709898650dfac863c3f7ad740b1b3d7f90ee | |
parent | 21d5bb33a296716c21371a809f5d9b6baeb54c17 (diff) | |
download | redmine-c9cf695ad7631813771e6107c1a373db9727a632.tar.gz redmine-c9cf695ad7631813771e6107c1a373db9727a632.zip |
Wrong columns after CSV export (#26785).
Patch by Mizuki ISHIKAWA.
git-svn-id: http://svn.redmine.org/redmine/trunk@17686 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/issues_controller.rb | 3 | ||||
-rw-r--r-- | test/functional/issues_controller_test.rb | 19 |
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 |