From c9cf695ad7631813771e6107c1a373db9727a632 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Tue, 4 Dec 2018 09:23:18 +0000 Subject: [PATCH] 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 --- app/controllers/issues_controller.rb | 3 ++- test/functional/issues_controller_test.rb | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) 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 -- 2.39.5