From 589d491773228a8177f5c3774f577407fd7902d4 Mon Sep 17 00:00:00 2001 From: Tobias Stenzel Date: Mon, 22 Oct 2018 20:16:33 +0000 Subject: [PATCH] fix Issue CSV export options: checkboxes have no effect for activated columns This adds an argument ignored_column_names to query_as_hidden_fields_tags which is used to ignore the description and last_notes columns for issues. --- app/helpers/queries_helper.rb | 5 ++++- app/views/issues/index.html.erb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 01d10d883..c24f7f6f5 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -339,7 +339,8 @@ module QueriesHelper end # Returns the query definition as hidden field tags - def query_as_hidden_field_tags(query) + # columns in ignored_column_names are skipped (names as symbols) + def query_as_hidden_field_tags(query, ignored_column_names = []) tags = hidden_field_tag("set_filter", "1", :id => nil) if query.filters.present? @@ -354,6 +355,8 @@ module QueriesHelper tags << hidden_field_tag("f[]", "", :id => nil) end query.columns.each do |column| + next if ignored_column_names.include?(column.name) + tags << hidden_field_tag("c[]", column.name, :id => nil) end if query.totalable_names.present? diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index c02c18368..5536021d9 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -29,7 +29,7 @@