Feature #6432
closedAllow unchecking all trackers in Roadmap view sidebar
0%
Description
Extensive subject¶
Allow a Roadmap view, without any related issues, when at least one tracker is configured by a Redmine Administrator as to show its issues by default on the roadmap1.
Introduction¶
I noticed some unexpected behaviour in the roadmap view a while ago which I already discussed over IRC with Eric Davis. Here follows an extraction.
Discussion¶
Mischa The Evil wrote:
When I deselect all trackers I expect to recieve a roadmap view showing all versions without any related issues. Instead, I recieve the roadmap with the related issues in the trackers that are selected by the Redmine Administrator as to be shown on the roadmap by default.
This is due to the fact that when I deselect all trackers no
:tracker_ids
params are passed to theVersionsController
hence@selected_tracker_ids = (default_trackers || selectable_trackers).collect {|t| t.id.to_s }
becomes assigned2.If the url is manually crafted into something like "/roadmap?tracker_ids%5B%5D=none" (notice the explicit
none
-value) the expected roadmap view is rendered though.There doesn't seem to be any hidden fields for none that are selected. It seems rather caused by the
retrieve_selected_tracker_ids
method in theVersionsController
(source:/trunk/app/controllers/versions_controller.rb#L147), which checks if anytracker_ids
-params are in the URL and because I deselected all trackers there aren't any.class VersionsController < ApplicationController ... def index @trackers = @project.trackers.find(:all, :order => 'position') retrieve_selected_tracker_ids(@trackers, @trackers.select {|t| t.is_in_roadmap?}) ... end ... ... private ... def retrieve_selected_tracker_ids(selectable_trackers, default_trackers=nil) if ids = params[:tracker_ids] @selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s } else @selected_tracker_ids = (default_trackers || selectable_trackers).collect {|t| t.id.to_s } end end end
Eric Davis wrote:
If you unselect everything, I would think it would return nothing and not the default.
Mischa The Evil wrote:
Redmine returns the default there because of a specific setting for each of the trackers to show the tracker in the roadmap whether or not. It's code from the time we also had the seperate changelog view3.
Eric Davis wrote:
Hmm...
Mischa The Evil wrote:
Indeed, my reaction was the same at first. I was so far able to trace the issue back to the
retrieve_selected_tracker_ids
method in theVersionsController
.
Eric Davis wrote:
What do you think we should do?
Mischa The Evil wrote:
I can't tell (yet). Especially since it's acceptable that an admin configures all the trackers to be not shown on the roadmap by default. Thus I conclude upto now that Redmine can't rely on the existance of the
tracker_ids
-param in the URL if we want to be able to recieve the expected none setting... :SI'll add it as a feature request on Redmine to accept an explicit
none
-setting for the selected_trackers on the roadmap.
Footnotes¶
1 See RedmineIssueTrackingSetup.
2 The following graph shows the trace to this assignment. I took it from a full HTML-export from FreeMind (which I attach also as retrieve_selected_tracker_ids-FreeMind_html_export.zip).
3 This view is removed by JPL in r3162 which relates to issue #2972.
Files
Related issues
Updated by Jan Niggemann (redmine.org team member) about 12 years ago
Just for those wondering, this is still present in 1.4.3, although it's no big deal for us...
Updated by Mischa The Evil almost 5 years ago
- Related to Feature #32278: Display Global Roadmap without any tracker added
Updated by Mischa The Evil about 3 years ago
I just noticed this issue again. I haven't tested this thoroughly but the following patch should do the trick:
app/views/versions/_sidebar.html.erb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/views/versions/_sidebar.html.erb b/app/views/versions/_sidebar.html.erb
index abfe9c67c..6b34b34b8 100644
--- a/app/views/versions/_sidebar.html.erb
+++ b/app/views/versions/_sidebar.html.erb
@@ -3,6 +3,7 @@
<ul>
<% @trackers.each do |tracker| %>
<li>
+ <%= hidden_field_tag "tracker_ids[]", nil, :id => nil %>
<label>
<%= check_box_tag("tracker_ids[]", tracker.id,
(@selected_tracker_ids.include? tracker.id.to_s),
Updated by Mischa The Evil about 3 years ago
- File 0001-Allow-Roadmap-view-without-showing-any-related-issue.patch 0001-Allow-Roadmap-view-without-showing-any-related-issue.patch added
Here's a proper patch file, produced by git format-patch
, against trunk @ r21200. It includes the diff I posted above and a crude and rudimentary, but functioning system test.
Updated by Go MAEDA about 3 years ago
- Target version set to Candidate for next minor release
Updated by Go MAEDA about 3 years ago
- Target version changed from Candidate for next minor release to Candidate for next major release
Updated by Go MAEDA about 3 years ago
- Target version changed from Candidate for next major release to 5.0.0
The patched behavior is more natural than the current behavior. To me, this is rather a "Defect" than a "Feature".
Setting the target version to 5.0.0.
Updated by Go MAEDA about 3 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the patch. Thank you for your contribution.
Updated by Marius BĂLTEANU about 3 years ago
- Status changed from Closed to Reopened
Mischa, Go, why did you choose a system test for this case? A functional test should be enough to cover this.
Updated by Marius BĂLTEANU over 2 years ago
- Status changed from Reopened to Closed
- fixed that hidden tag is render multiple
- added assertions to existing test
- remove the system test.
Updated by Marius BĂLTEANU over 2 years ago
- Subject changed from Allow Roadmap view without any related issues to Allow unchecking all trackers in Roadmap view sidebar