Defect #26836

Filtering issues via context menu should not reset selected columns

Added by Vincent Robert almost 2 years ago. Updated 5 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues list
Target version:4.0.3
Resolution:Fixed Affected version:4.0.2

Description

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

Steps to reproduce this bug:

  1. On /issues, change selected column and apply
  2. Check several issues
  3. Apply "filter" in context menu
  4. The query is applied: issues are well selected, but we lose our selected columns

02.png (161 KB) Vincent Robert, 2017-09-04 10:43

03.png (206 KB) Vincent Robert, 2017-09-04 10:43

01.png (244 KB) Vincent Robert, 2017-09-04 10:43

Associated revisions

Revision 17955
Added by Jean-Philippe Lang 5 months ago

Filtering issues via context menu should not reset selected columns (#26836).

Patch by Vincent Robert.

Revision 17956
Added by Jean-Philippe Lang 5 months ago

Send columns as a param to context menu instead of parsing back_url (#26836).

Revision 17957
Added by Jean-Philippe Lang 5 months ago

Merged r17955 and r17956 to 4.0-stable (#26836).

History

#1 Updated by Marius BALTEANU over 1 year ago

  • Status changed from New to Confirmed

#2 Updated by Vincent Robert 6 months ago

  • Target version set to 4.0.3
  • Affected version changed from 3.4.2 to 4.0.2

#3 Updated by Vincent Robert 6 months ago

Here is a basic implementation to fix this bug:

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(:x%x%).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 %>

#4 Updated by Jean-Philippe Lang 5 months ago

  • Status changed from Confirmed to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Patch committed, thanks. I made a slight change after that in order not to manually parse the back_url.

Also available in: Atom PDF