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