プロジェクト

全般

プロフィール

Vote #78789

完了

Filtering issues via context menu should not reset selected columns

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Issues list_58
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
58
version_id:
148
issue_org_id:
26836
author_id:
88801
assigned_to_id:
1
comments:
4
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
146
ステータス-->[Closed]

説明

If we use the context menu to filter issues, selected columns are reset to default.

Steps to reproduce this bug:

On /issues, change selected column and apply

Check several issues

Apply "filter" in context menu

The query is applied: issues are well selected, but we lose our selected columns

!01.png!

!02.png!

!03.png!


journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Here is a basic implementation to fix this bug:

<pre><code class="diff">
diff --git a/app/controllers/context_menus_controller.rb b/app/controllers/context_menus_controller.rb
index bd6977503..bef2826a4 100644
--- a/app/controllers/context_menus_controller.rb
+++ b/app/controllers/context_menus_controller.rb
@@ -43,6 +43,9 @@ class ContextMenusController < ApplicationController
@priorities = IssuePriority.active.reverse
@back = back_url

+ params = CGI.parse(@back)
+ @columns = params["c[]"]
+
@options_by_custom_field = {}
if @can[:edit]
custom_fields = @issues.map(&:editable_custom_fields).reduce(:&).reject(&:multiple?).select {|field| field.format.bulk_edit_supported}
diff --git a/app/views/context_menus/issues.html.erb b/app/views/context_menus/issues.html.erb
index 7919472af..f979cd0e2 100644
--- a/app/views/context_menus/issues.html.erb
+++ b/app/views/context_menus/issues.html.erb
@@ -134,7 +134,7 @@
<% end %>

<% unless @issue %>
- <li><%= context_menu_link l(:button_filter), _project_issues_path(@project, :set_filter => 1, :status_id => "*", :issue_id => @issue_ids.join(",")),
+ <li><%= context_menu_link l(:button_filter), _project_issues_path(@project, :set_filter => 1, :status_id => "*", :issue_id => @issue_ids.join(","), :c => @columns),
:class => 'icon icon-list' %></li>
<% end %>
</code></pre>
--------------------------------------------------------------------------------
Patch committed, thanks. I made a slight change after that in order not to manually parse the back_url.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリIssues list_58 にセット
  • 対象バージョン4.0.3_148 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0